• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: TextEdit, delete all blank lines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TextEdit, delete all blank lines


  • Subject: Re: TextEdit, delete all blank lines
  • From: Christopher Nebel <email@hidden>
  • Date: Mon, 11 May 2009 10:54:17 -0700

On May 9, 2009, at 10:37 AM, John Masters wrote:

Anyhow, tested on the command line the following works as a shell script:

"sed '/^ *\\$/d' filename1 > filename2"

so do shell script with the above should work. Has the advantage of preserving the original file.

For those of you who aren't regular-expression-literate, note that the above script doesn't do quite the same thing as the original AppleScript script: this one deletes any line composed of zero or more space characters -- in other words, lines that are visually empty. To make it delete only lines that are completely empty, remove the " *" bit.



--Chris Nebel AppleScript Engineering _______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >RE: RE: Excel Save as text question (From: "Christian Sonntag <email@hidden>" <email@hidden>)
 >TextEdit, delete all blank lines (From: Satyam Satyanarayana <email@hidden>)
 >Re: TextEdit, delete all blank lines (From: Axel Luttgens <email@hidden>)
 >Re: TextEdit, delete all blank lines (From: John Masters <email@hidden>)

  • Prev by Date: Re: Xcode and applescript
  • Next by Date: Re: Interacting with external shell scripts
  • Previous by thread: Re: TextEdit, delete all blank lines
  • Next by thread: Re: Excel Save as text question
  • Index(es):
    • Date
    • Thread