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