Word seraching and returning the coressponding line number

studio

#1

Hi,

How to search a specific word in a text file and display a word with corresponding line number.

Thanks,
Vinath.


#2

Hi,

You may not need RPA here I think. You can rely on a batch script to achieve it. However if you still want to try using RPA, Open the text file in Notepad++ and search for the word in the entire document. Then it should return a result set as below, which can be screen scrapped.

Filetest.txt (3 hits)
Line 1: test
Line 3: test
Line 4: rtyrt rtyr test y yerter

Regards,
Shiju


#3

Hi @shijutmathew,

This is the work flow i have created.Is there any mistakes in thatMain.xaml (7.5 KB)

Thanks,
Vinath.


#4

Hi @vinathkumar,

You will not be able to use the read text output and iterate over it line by line. It will iterate character by character. Please see the work flow attached MainWordSearch.xaml (8.0 KB)

Regards,
Shiju


#5

Hi @shijutmathew,

I dont want to display each and every line. i want to display if the word is found i line 5.

i want to display like this “The Word is found in line no 5”


#6

Hi @vinathkumar,

Please refer the below xaml file.
Main (11).xaml (10.1 KB)

Regards,
Arivu