I have this :
S=`cat sales.txt`;
echo "$S" | cut -d: -f5 | grep -E '[0-9][0-9][0-9]' | wc -l
My Textfile : name:id:number:type:value
Tom:8:987654:A:67 //1
Dick:9:7651:B:83 //2
Harry:5:21215121:A:92 //3
Molly:2:1231872231:A:44 //4
Megan:123:322:B:145 //5
Russia:8:99231272:B:530 //6
Boleh:123:29321831:C:5000 //7
I am trying to count the number of lines whereby the 5th column value are in the range of 0-999 .
When I try to run , it gives me count of 3 where it should be 6 .