Live data from Hacker News

Miller: Like Awk, sed, cut, join, and sort for CSV, TSV, and tabular JSON

github.com

41–50 of 109 posts

Re: Miller: Like Awk, sed, cut, join, and sort for CSV, TSV, and tabular JSON

#41
post #24

Miller is a welcome addition to my toolbox. I just wish it was as 'easy' to use as jq... part of that might be how infrequently I work with CSVs

Huh? jq has far more difficult syntax...

The syntax is pretty crazy, so there's a learning curve. But once your over the hump, jq is easy to use for transformations or "querying" of large volumes of json data.

Re: Miller: Like Awk, sed, cut, join, and sort for CSV, TSV, and tabular JSON

#42
post #33
post #10

Even without aliases, I still prefer PowerShell on Windows. Once you've turned the text into an object, you can pipeline it to hell. Get-Content .\example.csv | ConvertFrom-Csv | Where-Object -Property color -eq red

No thank you. I appreciate the power, speed, simplicity and flexibility of UNIX/GNU style text tools. I-Also-Don't-Want-To-Be-Locked-Into-This-Ridiculous-Syntax-Nightmare.

It's funny to me that people hate how verbose posh is when bash syntax looks like my cat walked over my keyboard

Re: Miller: Like Awk, sed, cut, join, and sort for CSV, TSV, and tabular JSON

#43
post #19
post #17

Earlier quoted context omitted.

Can you share some of the reasons you don't like it?

While powershell has gotten a lot faster in the most recent versions its still pretty slow for anything involving computation; most of the type my equivalent python code beats the pants off of it. The expressiveness is nice, but oftentimes modules won't support it or require weird ways of using the data to get the performance you want (mostly by dropping out of the pipe.) The choices around Format- vs Out- vs Convert…

My philosophy about any shell language is that if performance is a concern, then you should probably use a real programming language for it. Using shell scripting to handle batch processing tasks just creates dependencies on unmaintainable code.

Re: Miller: Like Awk, sed, cut, join, and sort for CSV, TSV, and tabular JSON

#44
post #24

Miller is a welcome addition to my toolbox. I just wish it was as 'easy' to use as jq... part of that might be how infrequently I work with CSVs

Huh? jq has far more difficult syntax...

Yea agreed. The moment I need to do anything complicated I start getting this gut feeling I’d be better off just writing a quick Go cli tool.

Re: Miller: Like Awk, sed, cut, join, and sort for CSV, TSV, and tabular JSON

#45

Discussion of a similar tool last month: yq: command-line YAML, JSON, XML, CSV and properties processor https://news.ycombinator.com/item?id=34656022 Also mentions gojq, Benthos, xsv, Damsel, a 2nd yq, htmlq, cfn-flip, csvq, zq, and zsv.

Seems like you meant https://github.com/TomWright/dasel (instead of damsel)

Re: Miller: Like Awk, sed, cut, join, and sort for CSV, TSV, and tabular JSON

#46
post #27

How is it better that SQL for these tasks on tabular data? That's the first question I have after reading the title. Haven't read the article. Edited the first sentence. Originally it was "Why it is not called SQL if works on tabular data?". My point, if one wants cat, sort, sed, join on tabular data, SOL is exactly that. Awk is too powerful, not sure about it.

> How is it better that SQL for these tasks on tabular data? It has far better handling of a CSV/TSV file on the command line directly and is compasable in shell pipelines. > My point, if one wants cat, sort, sed, join on tabular data, SOL is exactly that. SQL is a language for data in the form of tables in relational databases. While it can do sorting or joining or some changes, it is meant for a different domain th…

csvsql is the first google result for "sql in command line for csv"

https://towardsdatascience.com/analyze-csvs-with-sql-in-comm...

Re: Miller: Like Awk, sed, cut, join, and sort for CSV, TSV, and tabular JSON

#48

Earlier quoted context omitted.

It's indeed written in Go now, which indeed has GC, and ultimately all memory is freed ... but there are indeed some issues around intermediate retention of memory, taking more memory than one would have expected. Some gains were made on https://github.com/johnkerl/miller/pull/1133 and https://github.com/johnkerl/miller/pull/1132

See also https://github.com/johnkerl/miller/issues/1119

And https://github.com/johnkerl/miller/pull/1131

Re: Miller: Like Awk, sed, cut, join, and sort for CSV, TSV, and tabular JSON

#49
post #39

Looks cool! It'd help to have some more full examples (including output) of what some common use-cases do in the README. After looking through this, I'm still scratching my head trying to think of what problem this could solve in my own practice, and I work with a lot of csv files daily

In some sense, there's no answer to your question because everyone's tool workflow is their own.

That said, the most recent invocation for me was `mlr --icsv --ojson cat < a515b308-9a0e-4e4e-99a2-eafaa6159762.csv` to fix up CloudTrail csv and after that I happen to be more muscle-memory with jq but conceptually next I could have `filter '$eventname == "CreateNodegroup"'`

Re: Miller: Like Awk, sed, cut, join, and sort for CSV, TSV, and tabular JSON

#50
post #45

Discussion of a similar tool last month: yq: command-line YAML, JSON, XML, CSV and properties processor https://news.ycombinator.com/item?id=34656022 Also mentions gojq, Benthos, xsv, Damsel, a 2nd yq, htmlq, cfn-flip, csvq, zq, and zsv.

Seems like you meant https://github.com/TomWright/dasel (instead of damsel)

Correct; thanks!
Post reply on HN