[HPADM] [HPADM Summary] Count number of character per line within a file (?)

From: Ruby Domalanta (rdomalan@dairy-farm.com.ph)
Date: Tue Nov 09 2004 - 20:54:00 EST


Thanks to everyone who responded so quickly. Special thanks to Danilo Israel
for providing solution that suits my needs.
# cat <filename> | awk '{print length($0)}'

For me, I just add print each line and at the end of it the total nos of
char per line.
# cat <filename> | awk '{print $0,"\t" length($0)}'

Cheers,
Ruby Ann Domalanta

> -----Original Message-----
> From: Ruby Domalanta
> Sent: Wednesday, November 10, 2004 9:16 AM
> To: 'hpux-admin@DutchWorks.nl'
> Cc: Ruby Domalanta
> Subject: Count number of character per line within a file (?)
>
> Dears,
>
> Is there a utility or script that will count the number of character per
> line within a file?
> Say, I have this file named label.
>
> Content of file label
> ---------------------
> HEADER;DFCLPAL;1;1;6;5 --> 22 characters
> LN=8;01;e7;la=0.200,4.700;lc=3;lf=1;ld=2;lh=1.000;li=0.300;lk=0: --> 65
> characters
>
>
> Thanks in advance,
> Ruby Ann Domalanta

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:44 EDT