Find part of string and remove entire line
8 views (last 30 days)
I have a text file that looks like this 'textfile.txt':
'Algorithm: G:\folder: Example'
'QAdR = 123678'
'QaDB = 9098'
'This is what I wanted'
How do i find all the special characters ':' & '=' and remove the entire row containing ':' & '=' and write it to 'textfile.txt'. My new 'textfile.txt' should only contain 'This is what I wanted'.
Angus on 11 Jun 2013
Edited: Angus on 11 Jun 2013
Hi, probably start by reading in the text file
Then you could check each line with a regexp and save it if it does not contain your characters.
...% save your line
and build a new text file from there.
Hope this helps as a start at least.