ezrosent / frawk

an efficient awk-like language
Apache License 2.0
1.24k stars 34 forks source link

Field assignment doesn't work in CSV mode #111

Open twhitehead opened 2 months ago

twhitehead commented 2 months ago
$ 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
ghuls commented 3 weeks ago

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]
twhitehead commented 3 weeks ago

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