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

I found this information: pressing ALT+{up,down} moves the complete lines (not just the selection) up and down, fixing indentation as you go. Hitting CTRL+D deletes the lines completely (not just the selection) without leaving any unwanted blank lines. I hope it helps you.