[Q] Search/replace within text file
Posted on 1997-10-13
I am working on a script to open up a semi-database -- actually a text file set up like this:
value 1a <TAB> value 2a <TAB> value 3a
value 1b <TAB> value 2b <TAB> value 3b
Once a certain action is performed upon one of the database entries (i.e. value 1b, 2b, 3b), I would like to delete that line from the text file. The first value on each line is unique within the whole file, replication of that first value is not a concern in writing the function.
When I import each line into the script, I set it up as such:
So, if (based on my first example) I was done with the line containing values 1b, 2b and 3b, I would like the entire second row deleted or replaced by a series of empty spaces.
Any help would be immensely appreciated.