3 ms·
JSON has the major annoyance that grep doesn't work well on it. You need tooling to work with JSON.
by jstanley 1y ago
JSON has the major annoyance that grep doesn't work well on it. You need tooling to work with JSON.
- theknarf 1y agogrep is a tool. jq is a good tool for json.
- kergonath 1y agogrep is POSIX and you can count on it being installed pretty much anywhere. That’s not the case for jq.
- whizzter 1y agoDo people contain themselvs to a POSIX conformant grep subset in practice, or do you mean GNU grep that probably doesn't behave according to spec unless POSIXLY_CORRECT is set?
- IAmBroom 1y ago"Anywhere" does not include Windows environments, which are over half the work computers out there.
- deleted 1y ago[deleted]
- krogenx 1y agoIf a workstation has Git installed on it, which I’d think would be the case for substantial number of engineers out there (…not just software engineers), grep is there due to Git BASH.
- re 1y agoAs soon as you encounter any CSVs where field values may contain double quotes, commas, or newlines, you need tooling to work with CSV as well. (TSV FTW)
- spicybbq 1y agoOne of my first tasks as a junior dev was replacing an incorrect/incomplete "roll your own" CSV parsing regex (which broke in production) with a library.
- IAmBroom 1y agoTSV is superior to CSVs, and it still angers me that Excel doesn't offer it as a standard input option, but your examples are fairly easily handled by eye in a text file. Tools definitely make it faster and more reliable.
- euroderf 1y agoASCII FS GS RS US ... just make decent font entries for them.
- rogue7 1y agoFor this I use gron [0]. It's very convenient. [0]: https://github.com/tomnomnom/gron https://github.com/tomnomnom/gron