News for hackers. Stuff that matters.
Re:Working with CSV files on shell/terminal by globular-toast on Wednesday June 28, 2023 @06:06AM (#36504436)
Another problem is CSV isn't really a text format. It's a binary format that just happens to look like text and most implementations will handle it if you edit it as text. But the record separator is meant to be specifically CRLF and there might be other complications. This can be confusing when using these tools to try to output another CSV. Do the `--csv` modes support also writing back to CSV?
Re:Working with CSV files on shell/terminal by benhoyt on Wednesday June 28, 2023 @07:14PM (#36513994)
No, unfortunately the Gawk/awk --csv option doesn't support writing back to CSV. FWIW, GoAWK supports CSV input mode with "-i csv" and CSV output mode with "-o csv" for this purpose, as well as special syntax for fetching a @"named-field" rather than a $numbered_field. Docs: https://github.com/benhoyt/goawk/blob/master/docs/csv.md