Top "Awk" questions

AWK is an interpreted programming language designed for text processing and typically used as a data extraction and reporting tool.

using awk with column value conditions

I'm learning awk from The AWK Programming Language and I have a problem with one of the examples. If I …

linux shell awk
bash: shortest way to get n-th column of output

Let's say that during your workday you repeatedly encounter the following form of columnized output from some command in bash (…

bash awk
Tab separated values in awk

How do I select the first column from the TAB separated string? # echo "LOAD_SETTLED LOAD_INIT 2011-01-13 03:50:01" | awk …

awk
Printing the last column of a line in a file

I have a file that is constantly being written to/updated. I want to find the last line containing a …

file awk tail
How to show only next line after the matched one?

grep -A1 'blah' logfile Thanks to this command for every line that has 'blah' in it, I get the output …

awk sed grep
Print all but the first three columns

Too cumbersome: awk '{print " "$4" "$5" "$6" "$7" "$8" "$9" "$10" "$11" "$12" "$13}' things

awk
How to merge every two lines into one from the command line?

I have a text file with the following format. The first line is the "KEY" and the second line is …

bash awk sed grep
awk partly string match (if column/word partly matches)

My dummy file looks like this: C1 C2 C3 1 a snow 2 b snowman snow c sowman I want to get …

awk
What is the difference between sed and awk?

What is the difference between awk and sed ? What kind of application are best use cases for sed and awk …

sed awk
Insert a line at specific line number with sed or awk

I have a script file which I need to modify with another script to insert a text at the 8th …

sed awk