As was pointed out, you can use Open, ReadLine, WriteLine, and Close to manipulate a file. These are the native commands, and you need to review the examples in the manual to put them to use.

I use a function that I wrote called "FileIO", which reads a text file into an array -
$Array = FileIO('filename', 'R')
- is all that's needed to load the file. This is usually much easier than using the native commands.

Once the data is in the array, you can use AScan() to search for data, or simply enumerate the array to evaluate each line, edit lines, insert or delete rows, etc. When you're done, call
$Rc = FileIO('filename', 'W', $Array)
to overwrite the original data with the new data. There's even an optional parameter to remove blank lines, which allows you to delete lines by simply clearing the array element. It's posted in the UDF library on my web site. There are similar UDFs published here to simplify reading and writing text files.

Actually I am a Rocket Scientist! \:D