To remove some lines from a file

Sebastian Busch sebastian_busch at gmx.net
Thu Oct 26 02:32:58 EDT 2006


Steve Holden wrote:
> Sebastian Busch wrote:
>> umut.tabak at student.kuleuven.be 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.

sebastian.



More information about the Python-list mailing list