Something about that wasn't liked on my system.  Returned 0 when there are 784 
in myfile.  


----- Original Message ----- 
From: "Larry Hiscock" <lar...@wcs-corp.com> 
To: "U2 Users List" <u2-users@listserver.u2ug.org> 
Sent: Monday, October 26, 2009 7:02:07 PM GMT -06:00 US/Canada Central 
Subject: Re: [U2] Count tab characters 

tr -d '\n' < myfile | sed 's/[^\t]//g' | wc -c 


Larry Hiscock 
Western Computer Services 


-----Original Message----- 
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of iggch...@comcast.net 
Sent: Monday, October 26, 2009 4:02 PM 
To: u2-Users 
Subject: [U2] Count tab characters 



Hi all, 



Can anyone tell me a unix command that will count the number of tab characters 
in a unix regular file?  I'm using the wc command to return bytes, lines, etc 
but now I need to count ONLY the tabs.  For some reason, I thought grep -c 
would work for me but forgot that that only returns the number of lines that 
have a tab character.  I could open the file sequentially and count but I need 
something that is fast fast fast. 



Thanks 
_______________________________________________ 
U2-Users mailing list 
U2-Users@listserver.u2ug.org 
http://listserver.u2ug.org/mailman/listinfo/u2-users 
_______________________________________________ 
U2-Users mailing list 
U2-Users@listserver.u2ug.org 
http://listserver.u2ug.org/mailman/listinfo/u2-users 
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to