2 ms·
Yep, this works fine (in GoAWK, gawk, and mawk, though not in original awk): $ cat t.usv && echo id␟name␟age␞1␟Bob "Billy" Smith␟42␞2␟Jane Brown␟37 $ g
by benhoyt 4y ago
Yep, this works fine (in GoAWK, gawk, and mawk, though not in original awk):
$ cat t.usv && echo
id␟name␟age␞1␟Bob "Billy" Smith␟42␞2␟Jane
Brown␟37
$ goawk -F␟ -vRS=␞ -vOFS=, '{ print $1, $2, $3 }' t.usv
id,name,age
1,Bob "Billy" Smith,42
2,Jane
Brown,37
I've also added explicit tests for ASCII and Unicode unit and record separators, just to ensure I don't regress: https://github.com/benhoyt/goawk/commit/215652de58f33630edb0c4463def18419e886ea4 https://github.com/benhoyt/goawk/commit/215652de58f33630edb0...