How to find/match specific values in notepad?

Hi All,

I have problem in which there is notepad which has a data.

In that, I want to read data’s one by one in between ‘START TRANSACTION’ to ‘END TRANSACTION’. After that it will read next part and so on.

How to achieve this ?

S1CNP249.txt (1.2 KB)
S1CNP249.txt (2.0 KB)

Hi @Muralikrishna_Surve

Please try with the following regular expression:

(?<=TRANSACTION START)(.|\r|\n)*?(?=TRANSACTION END)
1 Like

Hi @Muralikrishna_Surve

How about this expression?

System.Text.RegularExpressions.Regex.Match(YourString,"(?s)TRANSACTION START(.*?)TRANSACTION END").Tostring

Check out the XAML file

MultiplefilesRegex.xaml (6.7 KB)

Regards
Gokul

1 Like

Hi @Gokul001

Thanks for the quick reply.

But from above given solution it is running only 1st “TRANSACTION START & TRANSACTION END” and ending the process.

Requirement here is in 1 file there will be so many passages (Transaction Start & Transaction End) and in this it needs to loop through all the passages one by one.

Could you please help with this solution ?

Hi @Muralikrishna_Surve ,
Please use below xaml to extract the value.
MultiplefilesRegex.xaml (7.6 KB)

Regards,
Arivu

1 Like

Thanks alot @arivu96

Hi @Muralikrishna_Surve

How about this expression?

System.Text.RegularExpressions.Regex.Matches(Inputtext.Trim,"(?s)TRANSACTION START(.*?)TRANSACTION END")

Check out the XAML file

MultiplefilesRegex.xaml (7.5 KB)

Regards
Gokul

1 Like

Thanks alot @Gokul001

1 Like

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