|
|
|
|
|
by claystu
3615 days ago
|
|
To accomplish the same thing in awk: $ awk '{if ($3 < 36) print $1; else print $2}' data.txt
doe
jane
jack
bob
Python has a lot of strengths and is better than awk at a lot of things, but one-liner column based text processing on the command line is literally awk's bread and butter. |
|
Instead of writing scripts for each little task, I just write one-liners. When they become more than 2 lines long it becomes unwieldy and I switch it to a regular script.