5 ms·
I know enough awk to know it solves my problem, but use it to little to remember how, and the development experience is never very clean. What i would like is
by athrowaway3z 5y ago
I know enough awk to know it solves my problem, but use it to little to remember how, and the development experience is never very clean.
What i would like is an cli awk ide. (Rolls of the tongue right? )
Ideally i could write ... | awk-ide "scripts/thing.awk" | ...
If it exists, run it. Otherwise have it open an editor session that runs an awk program as i type it on some buffered data, shows the result, and have some hints on what syntax/variables are available.
- cle 5y agoI use this occasionally in Emacs with awk-mode to live edit awk programs against a data file: https://github.com/danlamanna/live-awk-mode https://github.com/danlamanna/live-awk-mode
- xelxebar 5y agoWhat about something like while inotifywait --event modify,move_self,delete_self script.awk; do awk -f script.awk input.txt; done in a tmux pane on the right with vim/emacs/whatever on the left? Note: You need to watch the move_self and delete_self events, since editors might use some file move/deletion dance instead of a direct modify to help prevent data loss in the event of a crash.
- kbrazil 5y agoI wrote something similar to this to query JSON and JSON lines with python instead of awk for text. It’s called Jellex (Jello Explorer) which is a TUI front-end to Jello. Jello is a python analog to JQ. https://github.com/kellyjonbrazil/jellex https://github.com/kellyjonbrazil/jellex