RE: Scripting question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If you're sure it's a space, how about 

	egrep ^[^ ].* <file> > <new file>

Check the new file and make sure you have all the lines you want. I
would count lines to find out how many total lines and how many don't
have a leading space.  The number of lines in new file should match the
difference.  Once you're happy, delete the old file.

sort can also be your friend if you want to look at the file.  IF you
sort the file you will put all the lines with a beginning space
together.  In vi, you can get the line number of the line where it
changes.  Another way to count lines.


Dana Bourgeois


> -----Original Message-----
> From: psyche-list-admin@xxxxxxxxxx 
> [mailto:psyche-list-admin@xxxxxxxxxx] On Behalf Of Leonard Miller
> Sent: Friday, July 11, 2003 6:16 AM
> To: psyche-list@xxxxxxxxxx
> Subject: Scripting question
> 
> 
> Hi,
> I have a file with over 38000 lines in.  Some of the lines 
> have a space at the beginning and I can delete those lines.  
> Is there a way using a script or vi that I can delete the 
> lines that begin with a space?
> 
> Thanks
> L
> 
> 
> -- 
> Psyche-list mailing list
> Psyche-list@xxxxxxxxxx 
> https://www.redhat.com/mailman/listinfo/psyche> -list
> 


-- 
Psyche-list mailing list
Psyche-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/psyche-list

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux