DEV Community

Query Filter
Query Filter

Posted on

awk2

awk -F~ -v k="$KEY" '{
key4=$4 # copy 4th field
gsub(/ /,"",key4) # remove spaces for comparison
if (key4 == k) print $0 # print original line untouched
}' ./CacheCplsOrder.dat

Top comments (0)