To remove some lines from a file

Chetan pandyacus.xspam at xspam.sbcglobal.net
Thu Oct 26 03:38:07 EDT 2006


Sebastian Busch <sebastian_busch at gmx.net> writes:

> 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.
I don't have the original post to know exactly what is needed, but looks like
something that can be done by a single sed script. 

-Chetan



More information about the Python-list mailing list