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: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Leonard Miller
> Sent: Friday, July 11, 2003 6:16 AM
> To: [EMAIL PROTECTED]
> 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
> [EMAIL PROTECTED] 
> https://www.redhat.com/mailman/listinfo/psyche> -list
> 


-- 
Psyche-list mailing list
[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/psyche-list

Reply via email to