While using vi, add marks to work with a chunk of lines.
To replace beginning of all lines, between the (inclusive) marks a and b, with ZZZ; we could write
:'a,'bs/^/ZZZ/
Where a has lower line number than b.
Thursday, July 29, 2010
AWK - IF OR condition
OR operator : ||
AND operator: &&
awk -F, '{if ($1=="abc" || $1=="abd") print $0}' InputFile
-F,
InputFile is comma-separated (Field separator F is comma)
if ($1=="abc" || $1=="abd") print $0
Select and print entire record ($0) when first field ($1) is either "abc" or "abd"
AND operator: &&
awk -F, '{if ($1=="abc" || $1=="abd") print $0}' InputFile
-F,
InputFile is comma-separated (Field separator F is comma)
if ($1=="abc" || $1=="abd") print $0
Select and print entire record ($0) when first field ($1) is either "abc" or "abd"
Subscribe to:
Posts (Atom)