Live data from Hacker News

CLI text processing with GNU awk

learnbyexample.github.io

1–10 of 136 posts

Re: CLI text processing with GNU awk

#3
Hello! Author here.

I am pleased to announce a new version of my "CLI text processing with GNU awk" ebook.

Learn the `GNU awk` command step-by-step from beginner to advanced levels with hundreds of examples and exercises. This book will dive deep into field processing, show examples for filtering features, multiple file processing, how to construct solutions that depend on multiple records, how to compare records and fields between two or more files, how to identify duplicates while maintaining input order and so on. Regular Expressions will also be discussed in detail.

Links:

* PDF/EPUB versions: https://learnbyexample.gumroad.com/l/gnu_awk (free till 31-August-2023)

* Web version: https://learnbyexample.github.io/learn_gnuawk/

* Markdown source, example files, etc: https://github.com/learnbyexample/learn_gnuawk

* Interactive TUI app for exercises: https://github.com/learnbyexample/TUI-apps/blob/main/AwkExer...

Bundle offers:

* Magical one-liners (https://learnbyexample.gumroad.com/l/oneliners/new_awk_relea...) is $5 (normal price $15) — grep, sed, awk, perl and ruby one-liners bundle

* All Books Bundle (https://learnbyexample.gumroad.com/l/all-books/new_awk_relea...) is $12 (normal price $32) — all my 13 programming ebooks

I would highly appreciate it if you'd let me know how you felt about this book. It could be anything from a simple thank you, pointing out a typo, mistakes in code snippets, which aspects of the book worked for you (or didn't!) and so on. Reader feedback is essential and especially so for self-published authors. Happy learning :)

---

Previous discussions:

* Learn to use Awk with hundreds of examples (https://news.ycombinator.com/item?id=15549318) — 478 points, Oct 2017, 116 comments

* Show HN: An eBook with hundreds of GNU Awk one-liners (https://news.ycombinator.com/item?id=22758217) — 539 points, April 2020, 48 comments

Re: CLI text processing with GNU awk

#5
I have been using ChatGPT for generating these kind of small CLI like this. My prompts look like this:

    - use jq to count a nested array "a.b.c.d"
    - find and delete empty folders using `find`
    - find and replace text using sed/awk
I found that using ChatGPT for these purposes boosted my productivity tremendously.

Re: CLI text processing with GNU awk

#6

I have been using ChatGPT for generating these kind of small CLI like this. My prompts look like this: - use jq to count a nested array "a.b.c.d" - find and delete empty folders using `find` - find and replace text using sed/awk I found that using ChatGPT for these purposes boosted my productivity tremendously.

[deleted]

Re: CLI text processing with GNU awk

#8
post #3

Hello! Author here. I am pleased to announce a new version of my "CLI text processing with GNU awk" ebook. Learn the `GNU awk` command step-by-step from beginner to advanced levels with hundreds of examples and exercises. This book will dive deep into field processing, show examples for filtering features, multiple file processing, how to construct solutions that depend on multiple records, how to compare records and…

Thanks for sharing this, it is pleasantly obvious you put a lot of work into this. I especially like the TUI application!

Will the web version of this book remain free even after August 31st?

Re: CLI text processing with GNU awk

#9
post #8
post #3

Hello! Author here. I am pleased to announce a new version of my "CLI text processing with GNU awk" ebook. Learn the `GNU awk` command step-by-step from beginner to advanced levels with hundreds of examples and exercises. This book will dive deep into field processing, show examples for filtering features, multiple file processing, how to construct solutions that depend on multiple records, how to compare records and…

Thanks for sharing this, it is pleasantly obvious you put a lot of work into this. I especially like the TUI application! Will the web version of this book remain free even after August 31st?

You're welcome and thanks for the feedback :)

Yeah, the web version is always free for all of my ebooks. And you can find the markdown source on GitHub, for example: https://github.com/learnbyexample/learn_gnuawk/blob/master/g...

I use `pandoc` to generate the PDF/EPUB versions from markdown. See my blog post https://learnbyexample.github.io/customizing-pandoc/ for details.

Re: CLI text processing with GNU awk

#10
post #7

What is better? Starting with awk or sed?

Depends on the task. Sed is typically used for search and replace and Awk is better suited for field based processing. Both these tools also have filtering features (regexp based, line number based, range, etc).

See also: When to use grep, sed, awk, perl, etc https://unix.stackexchange.com/q/303044

Post reply on HN