Check length of record

Hi,
I have a problem, please help me,
I have a flat file like this:

P00000000088888888999999999 0000999903 000000000000000000
P00000000077777777000000000 0000999903 000000000000000000
P00000000044444444333333333 0000999903 00000000000000000079875
P00000000066666666111111111 0000999903 000000000000000000
P00000000055555555222222222 0000999903 000000000000000000

Every record has 58 characters
I need to know which records doesn�t have 58 characters (in red)
How can i do that????
Thans for your help

Ministerio Levantando a Cristo - Vi�a del Mar - Chile

Hi.

Using awk:

awk 'length != 58' file
awk ' length($0)!=58 {print FNR, $0}' inputfile

OK, thanks
In this case "file" is the name of my input file?
Where do i print the records what doesn�t have 58 characters??
Thanks

Hi.

awk 'length != 58' file

Yes, "file" is the input filename.

This will print all records which don't have 58 characters (to answer your question specifically, it will print to standard output).

OK, really thanks.

---------- Post updated at 03:19 PM ---------- Previous update was at 03:19 PM ----------

thanks a lot jim mcnamara