[PLUG] gawk: repeating a field in printed output
Rich Shepard
rshepard at appl-ecosys.com
Fri Jun 15 22:45:07 UTC 2018
On Fri, 15 Jun 2018, Michael Rasmussen wrote:
> Having not used awk in 20 years or so my wild ass guess is you need to add
> commas at the ends of lines 2 and 3, unless awk treats newlines as argument
> separators.
>
> 1 BEGIN { FS="," }
> 2 { print $1, "00:00", $2"\n"
> 3 $1, "01:00", $3"\n"
> 4 $1, "02:00", $4"\n"
> 5 }
>
> And editing the script to add those commas and run on locally generated test
> data shows that to be the case.
Thanks, Michael. I totally spaced that!
Regards,
Rich
More information about the PLUG
mailing list