Code Comments
Programming Forum and web based access to our favorite programming groups."Janis Papanagnou" <Janis_Papanagnou@hotmail.com> wrote in message
news:cqv8sp$e0p$2@online.de...
> awk '/{/,/}/ { next } 1'
Thanks! That worked like a charm & much easier than my solution :)
One final question: is there an option in gawk that allows you to modify a
file in-place (like SED's -i option)? In my original script I was closing
the original file and then writing over it (since I had already read
everything into an array). I'm using GNU Awk 3.1.0 and I don't see any such
option.
Post Follow-up to this messageFrank wrote: > "Janis Papanagnou" <Janis_Papanagnou@hotmail.com> wrote in message > news:cqv8sp$e0p$2@online.de... > > > Thanks! That worked like a charm & much easier than my solution :) > > One final question: is there an option in gawk that allows you to modify a > file in-place (like SED's -i option)? In my original script I was closing > the original file and then writing over it (since I had already read > everything into an array). I'm using GNU Awk 3.1.0 and I don't see any su ch > option. I either don't know of any awk option; you'll have to do a file move, e.g. awk '...' <orig >new ; mv new orig If you insist to do it inplace you may want to use perl instead of awk. Your choice. Janis
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.