fork download
  1. awk '{for(i=1;i<=NF;i++){if(match($i,/^[0-9]{3}[,]?$/)){count++}};print "Line " FNR " has " count " number of 3 digits.";count=""}'
Success #stdin #stdout 0s 4508KB
stdin
I am trying to extract 3 digited numbers 333, 334, 335 from this string #should return 3
I have 243 pens for sale #should return 1
stdout
Line 1 has 3 number of 3 digits.
Line 2 has 1 number of 3 digits.