4 ms·
Interesting point. I've though that AWK should have a mode where it does proper quote parsing of CSV files. Maybe I'll add a -csv option for that (or just have
by benhoyt 8y ago
Interesting point. I've though that AWK should have a mode where it does proper quote parsing of CSV files. Maybe I'll add a -csv option for that (or just have it do it automatically when the FS is ',' -- though that wouldn't be backwards compatible).
- helper 8y agoIf you add a -csv I would use it!
- vram22 8y agoYou probably know it already, but in case not, the CSV format is not fully standardized, and so there are variations. So you might have to handle those to provide better support of the feature, if you implement it. https://en.wikipedia.org/wiki/Comma-separated_values https://en.wikipedia.org/wiki/Comma-separated_values For example, csv.reader in Python's csv module in the stdlib, has a dialect argument, due to this. https://docs.python.org/2/library/csv.html https://docs.python.org/2/library/csv.html https://docs.python.org/3/library/csv.html https://docs.python.org/3/library/csv.html
- jrumbut 8y agoPerhaps deal with quotes strings generally, and then quoted strings mode with FS=, is CSV mode, and that quoted string functionality is available elsewhere (and maybe also for output). Less intuitive maybe for beginners but more generally useful?