Pages

mardi 12 novembre 2013

awk: if a specific column contains a match


if a specific column of a file contains the matching string: it yes, print these lines:
set a = 200
awk  -v  col_value=$a   '{if ($5==col_value) print $0;}'   file

Aucun commentaire:

Enregistrer un commentaire