Re: To remove some lines from a file
[EMAIL PROTECTED] wrote: > ... I would like to remove two lines from a file. > ... I am quite new myself -- but wouldn't grep -v do that easier (and perhaps faster)? Greetings, Sebastian. -- http://mail.python.org/mailman/listinfo/python-list
Re: To remove some lines from a file
Steve Holden wrote: > Sebastian Busch wrote: >> [EMAIL PROTECTED] 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. -- http://mail.python.org/mailman/listinfo/python-list
Re: To remove some lines from a file
Chetan wrote: > Sebastian Busch <[EMAIL PROTECTED]> writes: > >> Steve Holden wrote: >>> Sebastian Busch wrote: >>>> [EMAIL PROTECTED] wrote: >>>>> ... I would like to remove two lines from a file. ... >>>> ... grep -v ... >>> ... show ... >> grep -v "`grep -v "commentsymbol" yourfile | head -2`" yourfile >> ... > 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 Hey! The task is: "Remove the first two lines that don't begin with "@" from a file." Actually, the grep-thing I offered will also delete copies of these two lines that occur in another place. That should be no problem if the file is something like @comment deleteme deleteme @comment data: x-y-dy However, if this is not the case, it cannot be done this way. How would you do it with sed? Best, Sebastian. -- http://mail.python.org/mailman/listinfo/python-list
Re: where is python on linux?
Frank Potter wrote: > ... where is the executable python file? ... does whereis python tell you what you want to know? sebastian. -- http://mail.python.org/mailman/listinfo/python-list