Awk is a small but capable programming language which is used for processing text. It was developed by Aho, Weinberger, Kerninghan at Bell Labs.
J...
For further actions, you may consider blocking this person and/or reporting abuse
Nice intro/overview! Awk is great, I've used it a lot ... I remember I often used it to read/parse log files and then generate SQL using Awk, in order to perform database changes. It's very flexible for this kind of extract/transform/output work.
Some Awk one-liners replace my use of other Unix tools like cut, grep, join. Some people use
perl
as a betterawk
but I prefer the simplicity of Awk.Awk is extremely flexible and easy to use. Can indeed replace cut/grep/join if you want to. And perl, never got into it, too complicated and cryptic, I prefer the C/javascript-like syntax of Awk.
Awesome Article! Great Hands on tutorial ❤
Best awk intro/summary I have read, thank you.
Output formatting becomes much better when you ditch
print
in favor ofprintf
.That was a fun introduction. Glad to add that as a tool in my toolbelt
Nice intro, good pointers. Thanks!
The picture is enough for me, thanks the author!
Interesting! Just wondering why a whole new language for a feature? (Not to sound critical).
Are there any specialised optimizations specific to file i/o and parsing the file at lower level ? If so, it would be great to have it also as wrapper for other langaugaes. Any benchmarking ?
🙂🙂
Hi Ishani,
awk
is a very old language (1977), predating scripting languages likeperl
andpython
. As part of Unix philosophy, it is used in combination with other Unix tools. It is simpler and faster to write than say apython
script. Mostawk
uses are simple one-liners to extract particular columns.It is indeed very fast as all it does is: For each line:
There was this famous article which showed that clever use of command-line tools can be several times faster than some big-data tools.
Very helpful! Thanks!
LOVE AWK!!!!!!!!!!!
Wow, pandas in Bash ! Does it support cluster computing? ;)
It may replace your cluster :P
See this article on how a bash script is 235x faster than a Hadoop cluster.