Read Specific Tet from Text File

Team,
PFA, Putty.txt
PuTTY.txt (11.9 KB)

From above file i need to extract below information -

Error Reading Detail Record Number <328>.
No Valid Institution for the specified Logo :
BAD Input file <09272021.csv> renamed to <09272021.csv.20210927.BAD>
END_ERROR

Any suggestions ?

1 Like

Hi @prerna.gupta

How about this expression

System.Text.RegularExpressions.Regex.Matches(YourString,"(?<=ERR\s*:\s)\S.*")

Check out this XAML file

TextFileRegex.xaml (6.3 KB)

image

Regards
Gokul

1 Like

PFA Snapshot where Output is not as expected.
Not sure how it worked for you ?

1 Like

Hi @prerna.gupta

As per your output we had the result. Can you tell us you did not get the correct output?

1 Like

I used the same.xml file but getting Incorrect Output.
Can you tell Studio version and activity version ?

1 Like

HI @prerna.gupta

Studio version & Uipath.System.activity → 22.10.3

Regards
Gokul

1 Like

Hi,

Can you try as the following?

String.Join(vbCrlf,System.Text.RegularExpressions.Regex.Matches(YourString,"(?<=ERR\s*:\s)\S.*").Cast(Of System.Text.RegularExpressions.Match).Select(function(m) m.Value))

Regards,

1 Like

@Gokul001 ,
Need similar string extraction help with attached file

PFA, Putty_Sample_Success.txt
Putty_Sample_Success.txt (11.6 KB)

From above file i need to extract below information -

INFO : Record Count = 1259
INFO : Credit Total = 142540.12
INFO : DebitTotal = 82835.63

Any suggestions ?
Thanks in advance

1 Like

HI @prerna.gupta

Check out this XAML file

TextFileRegex.xaml (9.0 KB)

image

Regards
Gokul

1 Like

Thanks much :slight_smile:
Its working as expected

1 Like

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