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