News for hackers. Stuff that matters.
Re:Data Science at the Command Line, 2nd Edition (2021) by synergy20 on Sunday May 05, 2024 @08:03PM (#40269799)
Thanks. I use 'rg' a lot but it finds part of the json text, not sure how 'jq' can be used with that since you're not finding a full json object in general
Re:Data Science at the Command Line, 2nd Edition (2021) by faizshah on Sunday May 05, 2024 @08:19PM (#40269889)
Oh I see, so what I do is I use rg -l aka —-files-with-matches. To produce the relevant files and I use the filepath as the key for the next part of the processing pipeline.

So the pattern is to reduce the candidate set of files with rg or find then extract the relevant parts using xargs jq then pipe to jq -s to produce the dataset.

Re:Data Science at the Command Line, 2nd Edition (2021) by synergy20 on Sunday May 05, 2024 @10:32PM (#40270613)
That makes sense, thanks!