It would therefore be nice to be able to do OFS = "," # (would probably do this in BEGIN) However, this will produce garbage in the output if the current input record has more fields than the array array has entries (the "garbage" would be data from the input file). However, awk may do this for me if I change the current fields: OFS="," # (would probably do this in BEGIN) Joined_string = (joined_string = "" ? array : joined_string "," array) Instead, I end up with writing code like for (key in array) One thing I really miss in awk is the ability to join an array with a delimiter, like with the join command in Perl, typically done for immediate output. Reference: The POSIX standard for the awk utility.
0 Comments
Leave a Reply. |