Parsing question

Hi,
I read a PDF to text file. In that text file, the header row comes in one row and the data row comes into another row. For example:
Previous Amount Received Forward Adjustments 3/12/2022 Total Amount Due
$2,127.56 -$2,127.56 $0.00 $0.00 $3,137.56 $6,137.56

I need to get Total Amount due from the above. How to map exactly Total Amount due to the amount below? Please advise in general every data with headers and data columns. Thank you,

Just split the data row on " " and take index 5

Split(yourString," ")(5)

Thank you, @postwick

There is space between words for example “Total Amount Due”

Thank you

That’s irrelevant. You don’t split the header row, it’s irrelevant. Just split the data row to get the last value, because we know that’s the value you want.

@A_Learner
Try Through Regex:

1 Like

Thank you, @postwick

Thanks a lot! @raja.arslankhan

1 Like

Hi,
What changes I need to make when the amounts line is in a separate line? Right now the regex includes spaces after the Total Charges due.

thank you,

@A_Learner can you give me example?

The following two are separate lines. Thank you,

Previous Amount Received Forward Adjustments 3/12/2022 Total Amount Due
$2,127.56 -$2,127.56 $0.00 $0.00 $3,137.56 $6,137.56

@A_Learner so you want to read it as a new line? you can select multiline option in match activity

so can I replace \s* in your solution with \r\n (for one line)?

Thank you

@A_Learner
This one is valid for multiple spaces after Due and its also valid for multiline

1 Like

Yes, you are right. Thanks so much!!

1 Like

How to gain knowledge with complex Regex?

Thanks,

@A_Learner
Start from basic then go for complex, basic will be helpful to make chunks in long pattern.

1 Like

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