I have a text a file in that i want remove some lines. how can i do that can anyone help me please

I have text file in that there are some unwanted lines i need to remove all these lines how can i do that. Can anyone help me please. this is screenshot of file


Here in the given screenshot above user id i should remove entire data.

Hi @sandhyareddy,

Try this, it will remove everything after the last instance of “SQL>”:

YourText = YourText.Split({"SQL>"},StringSplitOptions.None).Last

Hi @sandhyareddy ,
Please follow below step,

  1. Used read text activity and create Variable.
  2. YourVar = YourVar.replace(“pass the text you want to replace”,string.empty)

Thanks,

Hi @sandhyareddy
Can you please provide the text file, it will be helpful to solve.

@sandhyareddy

If you want to remove the initial lines then try this

Read the data into a string variable str

Then use assign withstr = "USER_ID" + Str.Split({"USER_ID"},StringSplitOptions.None)(1)

Cheers