Re: shell script and text manipulation
Re: shell script and text manipulation
- Subject: Re: shell script and text manipulation
- From: John Stewart <email@hidden>
- Date: Wed, 23 Feb 2005 09:56:36 -0500
On 2/23/05 at 11:13 AM, the entity Christian Vinaa spoke thusly
>finding (myWord) and replacing with (myOtherWord)
>
>(just the jist of the script - not actually working)
This works but as written it will replace all instances of the searched for text within the body of the text being searched.
set txtStr to "some text to be searched"
set srchStr to "text"
set rplcStr to "words"
set newTxt to my doRplc(txtStr, srchStr, rplcStr)
--> "some words to be searched"
on doRplc(txtStr, srchStr, rplcStr)
set {oldDelims, my text item delimiters} to {my text item delimiters, {srchStr}}
set temp to every text item of txtStr
set my text item delimiters to {rplcStr}
set txtStr to temp as text
set my text item delimiters to oldDelims
return txtStr
end doRplc
JBS
--
_______________________________________________
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