frawk icon indicating copy to clipboard operation
frawk copied to clipboard

Field assignment doesn't work in CSV mode

Open twhitehead opened this issue 10 months ago • 2 comments

$ echo 1 2 3 | frawk '{ $1 = 0; print $0 }'
0 2 3

vs

$ echo 1,2,3 | frawk -i csv '{ $1 = 0; print $0 }'
1,2,3

twhitehead avatar Apr 20 '24 14:04 twhitehead

I guess this is expected according to the documentation:

    -i, --input-format <csv|tsv>
            Input is split according to the rules of (csv|tsv). $0 contains the unescaped line.
            Assigning to columns does nothing [possible values: csv, tsv]

ghuls avatar Jun 06 '24 09:06 ghuls

Good point. Guess this should be a feature request then and not a bug report. :smile:

twhitehead avatar Jun 06 '24 13:06 twhitehead