bash - AWK, delete record when field match -


i use regular file has 2 fields, 1st account name (with spaces) , 2nd integer number, both fields separated \t , records separated \n. problem need delete records match 1st field string. code below:

awk -v apenom="$apeynom" -f "\t" ' $1 != apenom { print $0; } ' $1 > $temp_file_2 

it works records not first record, never matches first field first record?

try changing script to:

'$1 != apenom { print $0; next } { print "mismatch[", $1, "]" }' 

i have feeling have dirty input. there might space before separating tab character or something. have print out $1 when skipping.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -