29 ms·
Nice introduction (based on both tutorials). One suggestion would be to use -v FPAT='[^,]*|"[^"]+"' instead of BEGIN { FPAT = "[^,]*|\"[^\"]+\"" } >
by asicsp 6y ago
Nice introduction (based on both tutorials). One suggestion would be to use
-v FPAT='[^,]*|"[^"]+"'
instead of
BEGIN { FPAT = "[^,]*|\"[^\"]+\"" }
>If you get the awk programming language manual…you’ll read it in about two hours and then you’re done. That’s it. You know all of awk.
I can't work my head around this quote. That's a ridiculous claim. Even for a experienced programmer, learning a new programming language in 2 weeks, let alone 2 hours would be nothing short of a miracle. I've been using awk for past 2-3 years or so and I wrote a book on GNU awk one-liners earlier this year (https://learnbyexample.github.io/learn_gnuawk/ https://learnbyexample.github.io/learn_gnuawk/). I'm nowhere close to knowing all of awk
- samoa42 6y ago> I've been using awk for past 2-3 years or so and I wrote a book on GNU awk one-liners not to criticise your work, but this does not sit well with me.
- asicsp 6y agoCould you elaborate? I didn't get your point.
- Athas 6y agoGNU Awk has lots of extensions and is a relatively big language, but I definitely think you can learn most of the original Awk in two weeks - and you can certainly learn enough to be useful in two hours. It's been a decade now, but my recollection is that when I spent a day or two idly reading the Awk book, and was able to immediately employ it in simple shell pipelines after reading not that many pages. I think Awk is useful once you've learned just a bit about it, and I don't think learning a lot about Awk is very useful - there are languages that are better suited for complex tasks.
- asicsp 6y agoFair enough, someone else made similar point that I had GNU awk in mind wrt all of awk And yeah, it's possible to start using basic field processing and regexp features (if you already know it) in 2 hours and learn most of it in 2 weeks. But, that quote could've been something like you could get started in 2 hours instead of saying one could know all of awk.
- djeiasbsbo 6y agoThis HN post inspired me to pick up and work through "The AWK Programming Language", so I have been doing that for the past two days. I'm currently at the beginning of chapter 5 (of 8). That quote is definitely ridiculous. He may have been referring to just chapter 2, in which the "whole language" is outlined. But later chapters also take time, there even is an exercise about writing an assembler in AWK as well as implementing multiple algorithms. Some stuff was already somewhat familiar to me from studying/practicing C earlier this year. Overall a 10/10 book so far, but takes time and patience for sure!