Remove lines

how to remove some lines from file having text like " anything can be" from .txt file

Hi @priyanka_tambe , you can do replace

yourstringVariable.Replace(“anything can be done”, “”).Trim

Hi @priyanka_tambe

Please try this,

string.Join(Environment.NewLine,strText.Split(Environment.NewLine.ToCharArray).where(function(x) not x.ToString.Contains(" anything can be")))

image

image

Thanks

1 Like

Hi @priyanka_tambe

If the issue got resolved, please mark it as solution and close the thread so it may be useful to others in the future.

Thanks

Hi @priyanka_tambe

Here is the package to manage the text files. It has many activities.

It has any activity called “Find Index” to give the line number which you are searching.
After that, you can use the “DeleteAt” activity to delete the specific line which it comes from the “Find Index”.

Regards
Balamurugan.S