SH_94
(Jacob SH)
December 29, 2021, 7:21am
1
Hi Community,
I was trying to use regex based extractor to extract figures from the Net Amount Due from the invoice but it has varieties format as follow text file attached:
For sample number 3,4 and 5, it does not appear in the same line
The original data screenshot invoice will be as follow (sample 5 ):
Testing.txt (1022 Bytes)
Would like to ask for help for the above five scenario of the invoice net amount due data.May i know if anyone face this issue before?
The expected output will be as follow:
Sample 1 ) 730,448.38
Sample 2 ) 593,126.84
Sample 3 ) 5,197.50
Sample 4 ) 236,645.35
Sample 5 ) 72,288.19
Many thanks again for the help.
1 Like
HI @SH_94
Can you send the expected output from the above?
Regards
Sudharsan
1 Like
If possible send the text file with preserved format
Regards
Sudharsan
1 Like
@SH_94
Try with this expression
(?<=Net Amount Due )((\d+.\d+.\d+))|(?<=\n)(\d+.\d+.\d+)
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET.
Regards
Sudharsan
SH_94
(Jacob SH)
December 29, 2021, 7:38am
6
Hi @Sudharsan_Ka ,
I have reuploaded the format using text and included the expected result.
Many thanks again
Testing.txt (1022 Bytes)
SH_94
(Jacob SH)
December 29, 2021, 8:03am
7
Hi @Sudharsan_Ka ,
I try the regex ady and it only work for sample 3 and 5β¦While sample 1,2 and 4 does not work in this case.
Many thanks in advance
HI @SH_94
(?<=Net Amount Due)\s+(\d+.\d+.\d+)|(?<=\n[A-Z]{3}\n\n).*(?=\n)
Try this and you need to do one thing before returning to excel
You need to trim the values
You need to split by space and return the last value
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET.
Regards
Sudharsan
1 Like
SH_94
(Jacob SH)
December 29, 2021, 8:11am
9
Hi @Sudharsan_Ka , i try using this one and now it does not work for sample 3 and 5. I reattached the text file just in case u miss it.
Testing.txt (1022 Bytes)
1 Like
both the values have been matched
The 3 and 5 values need to use split method to get the appropriate value
Can you try this split(Value 3," ")(2)
Regards
Sudharsan
2 Likes
SH_94
(Jacob SH)
December 29, 2021, 8:50am
11
Hi @Sudharsan_Ka ,
Is there anyway that we can automate to split it in the Uipath if we encounter this scenario? As the number can be change from time to time.
Many thanks again
1 Like
Okay but you need only the last value of the line right?
Regards
Sudharsan
1 Like
If you need the last value all the time you can use split like this
Split(β4,725.00 472.50 5,197.50 25β," β)(Split(β4,725.00 472.50 5,197.50 25β,β ").Count-1)
It will retrieve the last value in the whole string
Regards
Sudharsan
1 Like
system
(system)
Closed
January 1, 2022, 9:47am
15
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.