• 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: Simple character substitution
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple character substitution


  • Subject: Re: Simple character substitution
  • From: Gnarlodious <email@hidden>
  • Date: Sun, 26 Jun 2005 14:32:42 -0600

Entity Irwin Poche uttered this profundity:

set theText to "
I have been using a handler I'd written to do simple string
replacements, such as replacing all occurrences of \"this\" to \"that.\"
Its kludgy, but it's been working - up until I try to change a single
character to multiple characters.
I now realize that perl would probably be the best way of doing this
but how is anything but obvious for the uninitiated (me).  From other
postings I believe a do shell script with echo and perl are what I
probably need.
Can someone tell me how to do this ?
Thanks in advance,
-Irwin"

do shell script "echo " & the quoted form of theText & " | tr '\\r' '\\n' |
sed 's/this/that/g' "

-- Gnarlie


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Simple character substitution (From: Irwin Poche <email@hidden>)

  • Prev by Date: Re: Simple character substitution
  • Next by Date: Re: Simple character substitution
  • Previous by thread: Re: Simple character substitution
  • Next by thread: Re: Simple character substitution
  • Index(es):
    • Date
    • Thread