How to remove lines in text file?

How to remove lines in text file ?

Hi @AYUSH_J_CHANDRAN

Welcome to UiPath Forum.

You can try the below one

First read text file using ‘Read Text File’ activity and store the result in a string variable(Ex:strtext)

then use the below,

LineArray=strtext.Split(Environment.NewLine.ToArray, StringSplitOptions.RemoveEmptyEntries)
LineArray=LineArray.Skip(3).ToArray()

Where 3 is the index of the line you want to eliminate/remove.

Hope this will be useful. Thank you.

1 Like