[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] Thanks for awk-ward solutions



J.L. White wrote:
Hi Guys,

Many thanks for all the cool solutions to my awk problem (removing a recurring block of text from a file). The perl and awk ones produce identical great results (the sed one clearly only removes the 1st & last lines of the 25 line block.) Here they are again:

perl -ne 'print unless /Cannot connect/../Graphics support/' testc.inp > testc.out
cat testc.inp | awk '/Cannot connect/,/Graphics support/{next};{print $0}' > testc.out
cat testc.inp | sed -e 's/Cannot connect//' | sed -e 's/Graphics support//' > testc.out
OK, so I don't read things properly! Try this:

sed -e '/Cannot connect/,/Graphics support/d' testc.inp > testc.out

- J
___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

 GNU the choice of a complete generation.