wildcard in regex for awk

Hello I have a file like :

20120918000001413 | 1.17.163.89 | iSelfcare | MSISDN | N 
20120918000001806 | 1.33.27.100 | iSelfcare | 5564 | N
....

I want to extract all lines that have on 4th field (considering "|" the separator ) something other than just digits. I want to do this using a awk one-liner ( I don;t want shell commands because combination of grep, while, cut.. etc takes way too much time)

I have this command :

awk -F'|' '$4 == " [A-Z]* "' target_file.txt

But it doesn't work.

Try this one

awk -F\| '{if($4~/[a-zA-Z]+/){print}}' filename
1 Like

Hello , thank you, exactly what I needed!
awk rules (but I'm too lazy to learn it :stuck_out_tongue: )

awk -F\| '$4!~/^[0-9 ]+$/' input_file

JUST ANYTHING other than numbers....including special characters like $%^ etc

1 Like

Yes, this is more complete and accurate.

awk -F\| '$4~/[^0-9 ]/' file
1 Like