Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you're getting along fine without awk then by all means, don't learn it. But just today I had to quickly get a raw list of all US area codes (and only area codes). After a short Google search, I realized the fastest way of downloading and formatting it without having to do a secondary step was this:

  curl https://raw.githubusercontent.com/kedarmhaswade/cities/master/area-codes.csv | \
  awk -F, '{print $1}' \
  > ~/area_codes.txt
Now, could you use grep? Yeah, sure. But for really quick examples like this - things that lend themselves to it (e.g. a raw CSV with mostly crap you don't need but something you do), this is super fast. Anything more complicated and I'd break out a regex, though.


Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: