[macvoiceover] Re: blank lines

Richard;

This is where UNIX in Mac come in very handy, here is how to remove all blank lines for any file using the built in program awk enter the following at the command line of your computer.

awk NF /parth/to/your/file > /path/to/your/newfile

That is a capital NF by the way that's important.

The new file will now have all the blank lines removed. For example lets say you have a file in your documents folder called myfile.txt and you want to make a new version of it there called myfile2.txt with all the blank lines removed. Here is what you would enter at the command prompt:

awk NF ~/Documents/myfile.txt  >  ~/Documents/myfile2.txt

Now if your going to be doing this kind of thing all the time and you want a siple application that can do it let me known and I'll write one up but awk can do this quick and simple. Awk can do a whole bunch more as well.

Greg Kearney


On Jan 27, 2007, at 15:08 , Richard Most wrote:

Hi Greg,
That would be super.
Thank you very much.

On Jan 27, 2007, at 2:03 PM, Greg Kearney wrote:

I can write one for you.

Greg Kearney
On Jan 27, 2007, at 12:39 , Richard Most wrote:

Hi all,
I am trying to find a script that will strip blank lines from a text file. If any one knows of such script please let me know.
Thanks



Richard Most
louie@xxxxxxxxxxxxxxxxx




Click on the link below to go to our homepage.
http://www.icanworkthisthing.com

Manage your subscription by using the web interface on the link below.
http://www.freelists.org/list/macvoiceover

Users can subscribe to this list by sending email to macvoiceover-request@xxxxxxxxxxxxx with 'subscribe' in the Subject field OR by logging into the Webinterface at http://www.freelists.org/list/macvoiceover



Click on the link below to go to our homepage.
http://www.icanworkthisthing.com

Manage your subscription by using the web interface on the link below.
http://www.freelists.org/list/macvoiceover

Users can subscribe to this list by sending email to macvoiceover-request@xxxxxxxxxxxxx with 'subscribe' in the Subject field OR by logging into the Webinterface at http://www.freelists.org/list/macvoiceover




Click on the link below to go to our homepage.
http://www.icanworkthisthing.com

Manage your subscription by using the web interface on the link below.
http://www.freelists.org/list/macvoiceover

Users can subscribe to this list by sending email to macvoiceover- request@xxxxxxxxxxxxx with 'subscribe' in the Subject field OR by logging into the Webinterface at http://www.freelists.org/list/macvoiceover



Click on the link below to go to our homepage.
http://www.icanworkthisthing.com

Manage your subscription by using the web interface on the link below.
http://www.freelists.org/list/macvoiceover

Users can subscribe to this list by sending email to macvoiceover-request@xxxxxxxxxxxxx with 'subscribe' in the Subject field OR by logging into the Web interface at http://www.freelists.org/list/macvoiceover

Other related posts: