Help on splitting PDF text

Hi - I have an example of a string below

17062017 7.89 11-13-20 DOE JANE A 17062108 7.63 11-13-20 DOE JOHN B

This comes from a pdf with two columns of data. I need to get all numerical data before the names. Names are not always the same length but have a space before and after. Dates do not always end in 20 - could be 19 or 21, or moving forward 22. The first set of numbers - transaction ID is currently 8 characters but can expand moving forward and not all of the transaction IDs start with “1”. The dates, however, will allways be /XX for the year. I have tried splitting the string but am having disjointed luck. Working through regex but having similar difficulty…ideas?

Hi @Chris_Bolin … Are you looking something like this

Or Like this…

Note: You can see, the transaction # i have made it \d{8,} it means it can take anything >= 8…so no worries…whole pattern is generic

This is perfect - I was overthinking this!

1 Like

Have a few exceptions…on some row…shown below
17057908 9.00 10-19-19 JOHN DOE A 4 17058187 58.02 10-27-20 12-13-19 JANE DOE B

I may have a preceding “4” or “5”. I want to eliminate those from my match statement. I have tried ^[4,5] and (?(4,5)no) but no luck…thoughts?

In essence - all matches that are preceded by a 4 or 5 I want to eliminate from the match collection

@Chris_Bolin - Please check this…

Regex Pattern link

I see there are two dates in the second set…do you want both??

did that but I want to exclude the second set of values if it is preceded by the 4. So, here my match regex would not capture the 17058187 58.02 10-27-20 but only the 17057908 9.00 10-19-19. I did the pattern you show to exclude the digit 4 but I want to exclude everything that follows if there is a digit 4(space) or 5(space)

I do not need both dates

@Chris_Bolin - here you go…

Regex Pattern Link

Idea is to use the Negative Lookbehind …so anything does starts with 4or 5 does not get captured here…

I was just typing that I solved using the Negative Lookbehind as you posted your help! Thank you so much! Sometimes just talking it through to someone besides the voices in my head helps! I owe you dinner!..Chris

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.