I have a text file like the one below. I want to check the second column and print the count of values which have some special characters in them.
101,aaa,d01
102,*&%,d02
103,$%&,d03
104,###,d04
I tried with awk:
awk -F, '{if ($2 ~ (/^[$*&%#]+$/) count+1;} END {print count}' sample.txt
but it's not working. Is there any way other than awk to do it?