AWK - By Example

UNIX / Linux - General UNIX

This will remove the columns $4 $5 $12 and $13.

awk 'BEGIN{FS=OFS=" "}{$4=$5=$12=$13=""}{print}' file.txt

This is break down each line and numbers each field.

awk '{print NR": "$0; for(i=1;i<=NF;++i)print "\t"i": "$i}'

 

 

 

Article updates via email..


We have 20 guests online