6 ms·
Frawk: An efficient Awk-like programming language. (2021)
- SEXMCNIGGA11725 3y ago[flagged]
- SEXMCNIGGA5941 3y ago[flagged]
- SEXMCNIGGA48028 3y ago[dead]
- michaelcampbell 3y agoThe builtin CSV/TSV parsing seems the killer feature here, at least for me. I've been using SQL on CSV and JSON lately as it's mostly easiest for me, but I can think back a few times where I've used an *awk for a specific need, AND had to deal with CSV parsing at the same time.
- arp242 3y agoBoth GNU awk and "one true awk" added --csv last year, so as the README note mentions you probably don't need frawk for this (any more).
- tooltower 3y agoWhat's the common tool people use these days for manipulating json in an awk-like manner?
- hermitcrab 3y agoProbably: https://jqlang.github.io/jq/ https://jqlang.github.io/jq/
- rmetzler 3y agoI would say that lots of people use jq. But it’s not really awk-like. You could probably use gron with awk pretty easily, since gron stands for “greppable json”. But I also wonder how an awk with native json support would look like.
- mbivert 3y agoFood for thought: have a look at this paper[0] about structural regular expressions. The author (Rob Pike) sketches in the last section an awk-support. I remember using such regexps a while ago to tweak indented JSON and JSON-like data (the indentation allowed to loop on hashes easily). An awk with json support would for the most part need to be able to loop on hashes and arrays, and provide ways to travel in-depth. So far regular awk can travel through arrays (line-separator), and "in-depth" (e.g. nested "arrays") via regular loops & cie. Probably easier to think about it with a few concrete examples though. [0]: http://doc.cat-v.org/bell_labs/structural_regexps/se.pdf http://doc.cat-v.org/bell_labs/structural_regexps/se.pdf
- sceadu 3y agogron (https://github.com/tomnomnom/gron https://github.com/tomnomnom/gron) to transform it and query and then invert the transformation?
- tastyminerals2 3y agoIf you need just csv/tsv parsing, you can also take a look at https://github.com/eBay/tsv-utils https://github.com/eBay/tsv-utils
- fuzztester 3y agointerestingly, i had read somewhere earlier that those utilities were written in D. confirmed it by looking at the site just now.
- gpvos 3y agoI only found out recently that my favourite csv-munging tool, csvtool, is written in OCaml.
- tastyminerals2 3y agoYes, and with heavy use of one of the biggest D strengths -- CTFE (compile time eval). Great lib!
- fuzztester 3y agoHow do you use SQL on JSON? You mean only for strictly tabular JSON, i.e. no nesting beyond rows and columns?
- michaelcampbell 3y agoduckdb, as noted by someone else as well.
- kermatt 3y agoSpark and Drill have options, but DuckDB makes it almost trivial: https://duckdb.org/docs/data/json/overview https://duckdb.org/docs/data/json/overview
- fuzztester 3y agoThanks, will check that out.
- SEXMCNIGGA7518 3y ago[flagged]
- gpvos 3y agofrawk was the first awk to add proper CSV support, but the better-known awks have added it now as well, so its utility has become more limited. Edit: Actually, for correctness' sake: goawk started earlier (2018, frawk 2019). I didn't trawl through the history to see which was at a usable and/or CSV-supporting stage earlier. Both did support CSV before that became trendy though.
- gpvos 3y agoI couldn't help the historian in me: looks like frawk gained CSV support in early 2020 with some bugfixes in July/August that year, while goawk gained it in May 2022, so my initial comment was correct.
- deleted 3y ago[deleted]
- SEXMCNIGGA37088 3y ago[flagged]
- SEXMCNIGGA48411 3y ago[flagged]
- SEXMCNIGGA5526 3y ago[flagged]
- SEXMCNIGGA49553 3y ago[flagged]
- SEXMCNIGGA5741 3y ago[flagged]
- SEXMCNIGGA14401 3y ago[flagged]
- SEXMCNIGGA35938 3y ago[flagged]
- SEXMCNIGGA20031 3y ago[flagged]
- SEXMCNIGGA32918 3y ago[flagged]
- SEXMCNIGGA38987 3y ago[flagged]
- SEXMCNIGGA26822 3y ago[flagged]
- SEXMCNIGGA47550 3y ago[flagged]
- SEXMCNIGGA37116 3y ago[flagged]
- SEXMCNIGGA38155 3y ago[flagged]
- SEXMCNIGGA27017 3y ago[flagged]
- SEXMCNIGGA43325 3y ago[flagged]
- SEXMCNIGGA3245 3y ago[flagged]
- SEXMCNIGGA29119 3y ago[flagged]
- SEXMCNIGGA9197 3y ago[flagged]
- SEXMCNIGGA25557 3y ago[flagged]
- SEXMCNIGGA29949 3y ago[dead]
- SEXMCNIGGA42717 3y ago[flagged]
- SEXMCNIGGA37202 3y ago[flagged]
- SEXMCNIGGA25206 3y ago[flagged]
- SEXMCNIGGA29008 3y ago[flagged]
- SEXMCNIGGA21782 3y ago[dead]
- SEXMCNIGGA29200 3y ago[dead]
- SEXMCNIGGA14961 3y ago[dead]
- SEXMCNIGGA4087 3y ago[dead]
- SEXMCNIGGA48393 3y ago[flagged]
- anthk 3y ago>frawk is a small programming language for writing short programs processing textual data AWK can do far more than that. With netcat you can write an IRC/Gopher client in days. There are solitaries written in awk, even tetris and maybe, sokobans.
- dTal 3y agoYou underestimate it! https://github.com/TheMozg/awk-raycaster https://github.com/TheMozg/awk-raycaster