Get the third line from file .txt with uipath

Hello,

I have in my .txt the next lines:

So, I want only the third line, all the time the third line always changes , firt I read the file .txt and I saw all the file but I don´t know how I can get the third line??

Help please

Peter
123344
Esteban Juárez
Diary
RFC

Hi.

If you always want the 3rd line, then I can suggest that you .Split() the text by the Newline character. Then, you can pull the 3rd item.

text.Split({System.Environment.Newline}, System.StringSplitOptions.RemoveEmptyEntries)(2).Trim

I used an index of 2 in parentheses to extract the 3rd item in the list.

Hope that helps.

Regards.

1 Like

Its works, thank you very much!!!