Monday, May 3, 2010

Remove a line having a particular word

Hi,

Its a sed script rather a sed one liner.

Many a times you might have to remove lines that contain particular word from a file.
eg) In your pdb file you might want to remove all the HETATM records or all lines containing ANISOU , you could easily do it by the following line in your terminal

sed '/ANISOU/d' filename>outputfilename

The above code opens the file "filename" and deletes everyline that has ANISOU and saves it to "outputfilename"

1 comment: