Hi Team,
Using Read PDF text i am extracting data froma PDF and pasting it into a Text File.
It has some Amount infomation which is getting Extracted as
I want to get this amount I have used the following Expression but it isn’t working :
System.Text.RegularExpressions.Regex.Matches(Txt, “(?<=\sTotal\s*₹ )\d+(,|.)\d+(,|.)\d+”)(0).ToString
Can anybody Help me Rectify This ?
The Original Text File :
1.txt (647 Bytes)
I need to extract the value which is exactly below the Total Column like in the picture I have mentioned
Parvathy
(PS Parvathy)
September 15, 2023, 6:38am
2
Hi @Ishan_Shelke
System.Text.RegularExpressions.Regex.Match(Txt,"?<=Services- VD Subsidy(\s).*[\d].\d+\s)\d+\,?\d+\,?\d+\.?\d+").Value
Hope it helps!!
neha.upase
(Neha Upase)
September 15, 2023, 6:38am
3
Hi,
You can try this,
This expression should return the total amount as a string.
System.Text.RegularExpressions.Regex.Matches(Txt, “(?<=\sTotal\s*₹ )\d+(,|.)\d+(,|.)\d+”)(0).Value
HI @Ishan_Shelke
you can try this way both match and matches in regex
Match
System.Text.RegularExpressions.Regex.Match(str_Input,“[0-9]+(,|.)[0-9]+(,|.)[0-9]+(,|.).\d{2}”).Value
with matches you can cal with index
System.Text.RegularExpressions.Regex.Matches(str_Input,“[0-9]+(,|.)[0-9]+(,|.)[0-9]+(,|.).\d{2}”)(0).ToString.Trim
Hi @Parvathy ,
I am getting the following Error While Running
Parvathy
(PS Parvathy)
September 21, 2023, 11:04am
6
Hi @Ishan_Shelke
Make sure you can given the syntax correctly.
Regards
Hi @Ishan_Shelke
you can try this Regex Expression
str_input=“YourText”
System.Text.RegularExpressions.Regex.Match(str_input,“\d{1,3}(,|.)\d{1,3}(,|.)(\d{1,3})(,|.)(.\d{2})”).Value
output :-
1 Like
Parvathy
(PS Parvathy)
September 21, 2023, 6:25pm
8
Hi @Ishan_Shelke
Use this in Assign Activity
Save to: Output
Value to Save: System.Text.RegularExpressions.Regex.Match(Txt,"?<=Services- VD Subsidy(\s).*[\d].\d+\s)\d+\,?\d+\,?\d+\.?\d+").Value
Output variable is of DataType is System.String
Hope it helps!!
system
(system)
Closed
September 25, 2023, 6:55am
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.