3 ms·
I don't know of a "libawk" C library, but my GoAWK interpreter can also be used as a library (Go) library. See reference docs: https://pkg.go.dev/github.com/ben
by benhoyt 4y ago
I don't know of a "libawk" C library, but my GoAWK interpreter can also be used as a library (Go) library. See reference docs: https://pkg.go.dev/github.com/benhoyt/goawk/interp https://pkg.go.dev/github.com/benhoyt/goawk/interp
A project that's using it that way is Benthos, a "stream processor" written in Go. Awk is one of the "processors", the components that filter and transform data: https://www.benthos.dev/docs/components/processors/awk https://www.benthos.dev/docs/components/processors/awk
- DiggyJohnson 4y agoI’ve been really impressed by your ability to share your project in entirely relevant threads recently. Hope that doesn’t sound snarky, because I actually mean it. Awesome project. Keep on.
- benhoyt 4y agoHehe, thanks. Yeah, I was on the fence about posting it the last time, thinking "Hmmm, am I promoting my own project too much?" But I've tried to only do it in very relevant contexts or when people ask and it would solve that question.
- nequo 4y agoGoAWK's CSV mode is a great addition to AWK. Have you thought about adding a JSON mode, too, to get an AWK-flavored alternative to jq? Edit: I see that you have: https://github.com/benhoyt/goawk/issues/152 https://github.com/benhoyt/goawk/issues/152
- benhoyt 4y agoYeah, my comment there more or less sums up the thought I've put in so far. AWK doesn't really have nested data structures, but a lot of JSON / JSON lines is fairly flat, so it may work. It shouldn't be too hard ... though as I've noted there, there are a few tricky design issues to work though. Hope to come back to this at some point!
- distantwarning7 4y agoThe implementation is so beautiful…thanks for sharing it. This will make me better, I promise.