radius
1
I have file1.txt
LBP298W2,300,-18,-115,-12,-105
LBP298W2,300,-18,-115,LBP298W3,300
LBP298W3,300,-18,-115,-12,-105
---------- Post updated at 03:35 AM ---------- Previous update was at 03:34 AM ----------
i want to remove every line with non numeric value in column 5
expected result
LBP298W2,300,-18,-115,-12,-105
LBP298W3,300,-18,-115,-12,-105
zaxxon
2
Can try if this is sufficient:
$ awk -F, '$5 !~ /[a-zA-Z]/' infile
LBP298W2,300,-18,-115,-12,-105
LBP298W3,300,-18,-115,-12,-105
If zaxxon's proposal isn't sufficient for your purposes, this is more precise:
awk -F, '$5 ~ /^[-+]?[[:digit:]]+$/' file1.txt
With Perl (core modules):
perl -F, '-MScalar::Util qw(looks_like_number)' -lane'
print if looks_like_number $F[4]
' infile
radius
5
so much thank you...mr Zax, Don,& Radoulov