How to extract specific Text from notepad

Here i am haveing the text file, in that i want to extract only particular text (in my case i want to extract “Dynazzy” Which is company name and it is dynamic too) As shown below.
Capture
Deetails.txt (643 Bytes)
Can any one help me to find the solution
Thanks in advance

Hi @adarsh_kotagiri

Can you confirm this?
You need to extract the data dynamically from the second line right?
image

Regards
Sudharsan

yes sir, Dynazzy is one of the company name which is dynamic for each file.

Okay @adarsh_kotagiri

You can try using regex.

Regards
Sudharsan

@adarsh_kotagiri The text file file you posted is the invoice right?

If you created this text file with robot

Please send the text file with the preserved format

Regards
Sudharsan

ya sure , this is the pdf file where i converted to text
Invoice 1.pdf (28.8 KB)
Deetails.txt (643 Bytes)

Hi @adarsh_kotagiri

This can be done as follows

image

Regular Expression used

companyName = System.Text.RegularExpressions.Regex.Match(rText, "(?<=BILL TO\r?\n\r?\n[\w\ ]+\r?\n)[\w\ ]+").ToString

Run it on other files, there may be a need to tailor the regular expression so that it can work in all cases

Please refer the attached xaml file

How to extract specific Text from notepad.xaml (4.6 KB)

Also, please refer this post

1 Like

Hi @adarsh_kotagiri ,

You have many activities for data manipulation for textfile in the below package.

  • use " FindLineIndex " actiivity . It will return the Line index.
  • use Read Specific Line to read the specific line from the text file.

Regards
Balamurugan.S

1 Like

Thank you sir…

1 Like

Thank you soo much sir., It’s really working for each file

1 Like

@adarsh_kotagiri

Please mark suitable post as solution to close the topic

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