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

168,754
0
Published 2020-12-11
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:

blog.robertelder.org/intro-to-awk-command/?utm_sou…

SOCIALS
----------------
Patreon: www.patreon.com/RobertElderSoftware?utm_source=yt&…
Tiktok: www.tiktok.com/@roberteldersoftware
Linkedin: linkedin.com/company/robert-elder-software
Blog: blog.robertelder.org/?utm_source=yt&utm_medium=des…
Twitter: twitter.com/RobertElderSoft
Twitch: www.twitch.tv/roberteldersoftware
Github: github.com/RobertElderSoftware
Facebook: www.facebook.com/RobertElderSoftware
Instagram: www.instagram.com/roberteldersoftware/
Merch: store.robertelder.org/?utm_source=yt&utm_medium=de…

All Comments (21)
  • @user-uk9er5vw4c
    the narrative that lead to the tutorial is so cute as it never happened.
  • @nufosmatic
    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...
  • @cthyau
    I used to use awk every day about 30 years ago. A nice walk down the memory lane with this video.
  • @adam872
    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.
  • @tmanley1985
    I like how there was a narrative style to the video. That's really engaging. You've earned a sub!
  • @greob
    Thanks for sharing. Good luck with your 1% raise!
  • @BytebroUK
    'awk', 'sed', and 'Perl'. All I ever need for scraping from log-files!
  • @kellybmackenzie
    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!
  • @TON-vz3pe
    Wow.. I know awk well, but what a presentation. This is an underrated video. Keep it up dude.
  • @brokenregime
    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)
  • @bide7603
    Bro went from a 0x developer to a 0.5x dev
  • @MohamedAli-dk6cb
    Finally and after so many years, I understand how 'awk' works. Thank you, Legend
  • This is video is great and demystified awk in a very easy to understand way
  • @Dad-ij2qy
    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!
  • @BluesManPeich
    This is an amazingly instructive video. Thank you.
  • @xyve6129
    I always thought awk was super hard to learn. 😭 Thanks for explaining it so well! 🙏
  • @krozareq
    @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 = "([^,]+)|(\"[^\"]+\")"
  • @Quarky_
    Amazing presentation! I've been avoiding Awk for close to a decade, so much so I default to Sed for this kind of tasks! After watching your video, I feel more confident to try Awk next time :) Thank you!