This is part file
N W N N N N N N N N N
N C N N N N N N N N N
N A N N N N N N N N N
N N N N N N N N N N N
N G N N N N N N N N N
N C N N N C N N N N N
N C C N N N N N N N N
In each line I want to count the total number of all characters that are not "N"
my desire output
1
1
1
0
1
2
2
sed
to replace stuff you don't care about andawk
to count the remaining lengthsed 's/N//g ; s/\s//g' file | awk '{ print length($0); }'
– Rolf Oct 10 '17 at 07:19