wellster34
Programmer
Hi,
I'm learning unix as I go along but I'm having a problem. I have a data file that contains the following:
"123","45"
..etc...
I want to check in the "45" position to see if the 45 is missing so it only leaves double quotes -> ""
If the file contains:
"123",""
I want to omit that record of information from the data file. So, I tried the logic below:
awk '{
if( substr($0,7,2) -eq '""' ) print $0
}' < input.dat > new.dat
It obviously does not work. Does anybody know how to fix this code or have a new idea?
Thanks for your time.
I'm learning unix as I go along but I'm having a problem. I have a data file that contains the following:
"123","45"
..etc...
I want to check in the "45" position to see if the 45 is missing so it only leaves double quotes -> ""
If the file contains:
"123",""
I want to omit that record of information from the data file. So, I tried the logic below:
awk '{
if( substr($0,7,2) -eq '""' ) print $0
}' < input.dat > new.dat
It obviously does not work. Does anybody know how to fix this code or have a new idea?
Thanks for your time.