To remove some lines from a file

Sebastian Busch sebastian_busch at
Thu Oct 26 08:32:58 CEST 2006

Steve Holden wrote:
> Sebastian Busch wrote:
>> umut.tabak at wrote:
>>> ... I would like to remove two lines from a file. ...
>> ... grep -v ...
> ... show ...

grep -v "`grep -v "commentsymbol" yourfile | head -2`" yourfile

i frankly admit that there is also 'head' invoved ;)

i really have no idea -- but i always thought that these coreutils and
colleagues do their jobs as fast as possible, in particular faster than
interpreted languages... however, as i posted last time, i was actually
not aware that you have to call three of them.


More information about the Python-list mailing list