How The 'awk' Command Made Me A 10x Engineer

preview_player
Показать описание
Learning to use the 'awk' command increased my productivity significantly. awk allows me to quickly manipulate and inspect data in text files. This is especially true for column-based data, such as .csv files. Since awk is a fully functional programming language, I can quickly use awk to solve problems that are too complicated for programs like grep or sed.

A text-based version of this video with all commands can be found here:

SOCIALS
----------------
Рекомендации по теме
Комментарии
Автор

the narrative that lead to the tutorial is so cute as it never happened.

ukervwc
Автор

I used to use awk every day about 30 years ago. A nice walk down the memory lane with this video.

cthyau
Автор

Many moons ago I helped maintain what we thought might be the largest awk script ever created - it converted between the proprietary FORTRAN code for compilers by our competitors into our own proprietary FORTRAN code. Of course, monthly, if not weekly, we'd find something it did not convert properly, and it would have to be changed. Not only was it possibly the largest awk script, but it was the most modified awk script...

nufosmatic
Автор

The awk command is now my favorite Linux command

josefaguilar
Автор

I like how there was a narrative style to the video. That's really engaging. You've earned a sub!

tmanley
Автор

Thanks for sharing.
Good luck with your 1% raise!

greob
Автор

Utilities like awk are one of the reasons I love Unix. Everything is in a text file and the OS gives you the tools to parse and manipulate the contents.

adam
Автор

Bro went from a 0x developer to a 0.5x dev

bide
Автор

I enjoy using GREP and SED and I've been really wanting to learn how to use AWK. This video motivated me to do so, I'm gonna!! Also LOL, the end of the video made me laugh a lot. I love this!

kellybmackenzie
Автор

I get that awk is a useful tool overall, but with your given example, why exactly would writing a program be time consuming?

weaponkid
Автор

Wow.. I know awk well, but what a presentation. This is an underrated video. Keep it up dude.

TON-vzpe
Автор

@4:10 "As you see, awk is not quite this smart. And here you can see how awk isn't quite as good as a CSV parser. "

In GNU awk set the built-in FPAT variable. In your example: FPAT = "([^, ]+)|(\"[^\"]+\")"

krozareq
Автор

'awk', 'sed', and 'Perl'. All I ever need for scraping from log-files!

BytebroUK
Автор

The solution to the original problem was a bit of overkill, but this was a good example for some teaching of base awk functionality. This is a more direct and shorter solution, only changing the F lines and printing all lines:

$ awk '$2=="F" {$1=sprintf("%.1f", ($1-32)/1.8); $2="C";} 1' temps.csv

(the single "1" at the end is the condition, which evaluates as "true", evoking the default action: print -- nice shortcut if you mean only to change some lines but print all)

brokenregime
Автор

Thank you for describing the pattern-matching and default assumptions so thoroughly and illustrating each point with example code. Until today have never seen any awk tutorial that could get me up to speed so quickly as your video. Kudos!
Showing how awk can replace both the grep and sed commands was icing on your cake.
And your last sentence was a big flaming torch sitting atop the cake!

Dad-ijqy
Автор

Your content is brilliant. You must become more known! We desperately need more Unix content on youtube.

PauloConstantino
Автор

"I was so unproductive!" → Proceeds to open the Gnome terminal

Zeioth
Автор

This is video is great and demystified awk in a very easy to understand way

christopherweeks
Автор

I love how simple programs developed 50 years ago are still extremely useful.

That is because the core of Computing hasn't changed much at all over that time, and UNIX did an excellent job of capturing that core.

I pity the fools who know nothing outside of a GUI. Because with a GUI, you get a single tool that can do only what its designers allow you to do. But the UNIX concept is to have a load of little tools that one can combine to do exactly that what you want it to do.

Perhaps I should write a GUI overlay for the shell, allowing the old UNIX tools to be configured and linked together graphically. That would be fun, and might help people discover the tools that are available at the CLI.

TheEvertw
Автор

Finally and after so many years, I understand how 'awk' works. Thank you, Legend

MohamedAli-dkcb