Re:Learn to use Awk with hundreds of examples
by aseure on Wednesday October 25, 2017 @09:48AM
(#15550065)
I would also recommend the good awk blog post series of Jonathan Palardy:
[ Parent
| on HN ]
Re:Learn to use Awk with hundreds of examples
by asicsp on Wednesday October 25, 2017 @10:37AM
(#15550460)
glanced a bit, looks good.. will add it to further reading section, thanks :)
has some minor issues though
> modern (i.e. Perl) regular expressions
nope, supports only ERE.. doesn't have non-greedy, lookarounds, etc
> $ cat netflix.tsv | awk '{printf "%s %15s %.1f\n", $1, $6, $5}' | sed 1d
could have just added NR>1 condition..
Re:Learn to use Awk with hundreds of examples
by matt_wulfeck on Wednesday October 25, 2017 @11:47AM
(#15551093)
Yeah that’s really tough for me. PCRE really sets the bar for modern regular expression engines. Awk predates it by a decade.
Re:Learn to use Awk with hundreds of examples
by microtherion on Wednesday October 25, 2017 @03:22PM
(#15553257)
TWO decades!
Re:Learn to use Awk with hundreds of examples
by kazinator on Wednesday October 25, 2017 @01:59PM
(#15552414)
Not to mention that awk takes filename arguments, so this is an egregiously useless use of cat.
Re:Learn to use Awk with hundreds of examples
by twmb on Wednesday October 25, 2017 @03:17PM
(#15553216)
From the second post,
> Alternatively, awk '{print $2}' netflix.tsv would have given us the same result. For this tutorial, I use cat to visually separate the input data from the AWK program itself. This also emphasizes that AWK can treat any input and not just existing files.
Re:Learn to use Awk with hundreds of examples
by nejenendn on Wednesday October 25, 2017 @03:19PM
(#15553225)
Not to mention this is the point of the < operator.
Re:Learn to use Awk with hundreds of examples
by cannedslime on Wednesday October 25, 2017 @11:50AM
(#15551126)
Thanks to you... and OP! I have been using posix systems for years but never really touched awk because what I have seen have seemed like archaic chants of dark magic, very good resources for learning about this nifty tool.