Code Comments
Programming Forum and web based access to our favorite programming groups.
Frank wrote:
> 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.
If you store the lines in an array, you can simply write them
in the END section:
END {
for (i=1; i in Whole_File; i++ )
print Whole_File[ i ] >FILENAME }
The language Ruby has the in-place (-i) option.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.