Hacker News new | ask | show | jobs
by jstanley 287 days ago
JSON has the major annoyance that grep doesn't work well on it. You need tooling to work with JSON.
3 comments

As 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)

TSV 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.

One 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.
ASCII FS GS RS US ... just make decent font entries for them.
And keys on the keyboard.
Yes! But nobody ever came up with decent font entries that would look snappy on keys. Not even IBM (or Data General or Burroughs or whoever) I guess.
For this I use gron [0]. It's very convenient.

[0]: https://github.com/tomnomnom/gron

grep is a tool. jq is a good tool for json.
grep is POSIX and you can count on it being installed pretty much anywhere. That’s not the case for jq.
Do 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?
"Anywhere" does not include Windows environments, which are over half the work computers out there.
If 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.