Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Remove blank lines from a text file?

Remove blank lines from a text file?
Thread Tools
Dedicated MacNNer
Join Date: Apr 2003
Location: Detroit, MI
Status: Offline
Reply With Quote
Apr 9, 2005, 06:37 PM
 
I have a document that has extra blank lines a plenty. Any easy way to remove them? I have TextEdit, Word, and Pages but have not found a way to do it. Maybe an Apple script?

Thanks!
     
Mac Enthusiast
Join Date: Nov 2003
Location: great northwest
Status: Offline
Reply With Quote
Apr 9, 2005, 07:19 PM
 
There's a Service called Format that I think I got from Devon . Go there and download WordServices, which offers lots of cleanup possibilities, including removing blank lines. there's some other useful freeware at that site. I use them all the time.

There's also a Service called SmartWrap, and apps called PlainClip and TextSoap that clean up text.
     
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status: Offline
Reply With Quote
Apr 10, 2005, 04:16 AM
 
What format is the file? If it's just plain text, a simple Terminal command can do that.

Code:
sed -e '/^$/d' your-file-here.txt > output-file.txt
(Last edited by wataru; Apr 10, 2005 at 04:25 AM. )
     
Addicted to MacNN
Join Date: Jun 1999
Location: Las Vegas, NV, USA
Status: Offline
Reply With Quote
Apr 10, 2005, 05:56 AM
 
In Word, replace ^p^p with ^p

Chris
     
Dedicated MacNNer
Join Date: Apr 2003
Location: Detroit, MI
Status: Offline
Reply With Quote
Apr 10, 2005, 06:44 PM
 
Thank you all! I appreciate everyone who took the time to answer.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:21 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2