To remove some lines from a file

Roberto Bonvallet Roberto.Bonvallet at cern.ch
Thu Oct 26 13:14:42 CEST 2006


Sebastian Busch wrote:
> The task is:
> 
> "Remove the first two lines that don't begin with "@" from a file."

awk 'BEGIN {c = 0} c < 2 && !/^@/ {c += 1; next} {print}' < mybeautifulfile

-- 
Roberto Bonvallet



More information about the Python-list mailing list