https://ia802309.us.archive.org/25/items/pdfy-MgN0H1joIoDVoI...
Hmm, I did not know that (I have a print copy of that book).
> I wouldn't post a link to a pirated anything.
OK. But just in case, someone still wants a physical book, they can get it used from Amazon (can talk about Amazon in US) for ~$3.
Fast, but partly because it's not Unicode-aware: it treats strings as 8-bit character sequences rather than UTF-8. Often that's fine, if non-ASCII characters are only passed through unmodified, but requires some care to avoid problems.
$ echo $LANG
en_GB.UTF-8
$ echo "ÜNICÖDE" | gawk '{print tolower($0)}'
ünicöde
$ echo "ÜNICÖDE" | mawk '{print tolower($0)}'
�nic�de
I ran into this in practice because I was using awk to convert paper titles from "Title Case" to APA-style "Only first word of title capitalized" case. The garbled output led me down a rabbit hole where I discovered that only some awks support Unicode locales, and the default awk on Debian (mawk) isn't one of them.I'd love to see the mawk compilation technology merged to GNU awk. Or mawk updated with Unicode support and a few of the GNU extensions.
The other item on my awk-like wishlist is CSV support, ie split $1 .. $N by CSV rules instead of just a field separator. I usually end up copying CSVs into postgresql because it is fast and then I can process it very flexibly, but it's a bit heavy for things that could be one line-ers. Also, postgresql won't load malformed CSV, but I suspect awk could be less picky.
There is miller which hits some of these points, but I haven't really grokked it yet and the syntax seems ... awkward.
I have been reading through it and running code snippets from there as I find time. It's awesome!
If anyone's interested, I also update my notes from there on my blog.. https://scripter.co/notes/awk. I plan to have that notes post contain the entire book when I am done.
There is superb book, The AWK Programming Language, which teaches a lot about programming in addition to the awk language. Good discussion and link to pdf here: [0]
[0] https://news.ycombinator.com/item?id=13451454