Finding the records with a specified length

I have a sample txt file which has different variable lengths of 2,10,3,15.
What is the command that I need use in order to get the record count that has length '3'

Thanks

awk ' length($0)==3 {cnt++} {next} END {print cnt}' inputfile

one way using awk

Thanx ..dont we have any simple command line utility to demonstrate this..I am trying to use egrep ..but i dun have any idea about the options that needs to be appended with the egrep.

Any help would be really appreciated. Thanks

---------- Post updated at 08:40 AM ---------- Previous update was at 08:38 AM ----------

Sorry to say this but It doesn't yield me anything..Did you provide me the correct syntax..please let me know

Post a sample of your input file.