need help: about remove space
Michel van Deventer wrote, On 04/30/2010 10:55 AM:
> Hi, > > On Fri, 2010-04-30 at 07:46 -0700, adrian kok wrote: >> Hi all >> >> I have big file as below >> and would like to know how many line eg: wc -l file >> but can't figure out how to know >> >> If I type wc -l file, I only get the 1023 but it includes the space >> When I use cat file | tr -d " ". it gives me "adrian alice......" >> I need it as fileB and then wc -l fileB. >> > If those lines between the names are empty lines you might try : > cat bigfile | egrep -v '^$' | wc -l > > or if you want the names into a second file : > cat bigfile | egrep -v '^$' > fileB > > Regards, > > Michel Or if you don't mind loosing replicates: cat bigfile |sort |uniq > fileB -- Todd Denniston Crane Division, Naval Surface Warfare Center (NSWC Crane) Harnessing the Power of Technology for the Warfighter _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos |
| All times are GMT. The time now is 07:44 PM. |
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.