LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] silly shell thing

[ILUG] silly shell thing

Niall O Broin niall at magicgoeshere.com
Wed May 24 11:46:11 IST 2000


On Wed, May 24, 2000 at 11:25:27AM +0100, John P. Looney (Kate) wrote:

>  I've a file that for some reason a windows editor has put in double
> newlines everywhere.
> 
>  Anyone got a good way of getting rid of them ? I tryed:

Not sure what exactly you mean, as a Windows editor will usually put in \r\n
as a line end, so do you have at the end of each line \r\n\r\n or just \n\n ?
If it's the former, you can simply zap the \r with tr and then the following
little pearl :-) will solve your problem


perl -ne 'if (length > 1) {print}' screwed_up_file


Can't ask for simpler than that, can you ? I'm sure a similar idea will work
in awk, but I'm trying to wean myself off extinct sea birds :-)



Regards,


Niall




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell