Hi Everyone,
I do have a text and need to find text and extract text after value in text file.
Need to find the word “FILTRATION AREA” if its found need to extract its value “0.12 m” and text look like
“FILTRATION AREA: 0.12 m”
Please kindly refer the given attachment file.
TEST_TextFile.txt (2.3 KB)
Thank you!
Parvathy
(PS Parvathy)
June 3, 2024, 5:40am
2
Hi @victoryv4569
(?<=FILTRATION AREA:\s+)\d+\.?\d+\s*[a-z]+
Regards
1 Like
Parvathy
(PS Parvathy)
June 3, 2024, 5:44am
4
Hi @victoryv4569
=> Read Text FIle
Output → str_Text
=> Use the below condition in If
If
System.Text.RegularExpressions.Regex.IsMatch(str_Text,"FILTRATION AREA")
Then
Assign -> Value = System.Text.RegularExpressions.Regex.Match(str_Text,"(?<=FILTRATION AREA:\s+)\d+\.?\d+\s*[a-z]+").Value.Trim()
End If
=> Print Value in Message Box or Write Line
Sequence34.xaml (8.4 KB)
Regards
1 Like
Hi @victoryv4569
Can you try the below
If(System.Text.RegularExpressions.Regex.IsMatch(TextFile,"FILTRATION AREA"),System.Text.RegularExpressions.Regex.Match(TextFile,"(?<=FILTRATION AREA:\s?)(\d+[.,]\d+\s?\w+)").Value,String.Empty)
Regards,
1 Like
Hi @victoryv4569
Try below expression in Assign Activity
str_Input = yourText (FromPDF)
System.Text.RegularExpressions.Regex.Match(str_Input,"FILTRATION AREA:\s*([^:]+)").Groups(1).Value.Trim
Hope it will helps you
Happy Automation
1 Like
system
(system)
Closed
June 6, 2024, 6:02am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.