Reduce multiple characters to single occurrence (via do shell script?)
Reduce multiple characters to single occurrence (via do shell script?)
- Subject: Reduce multiple characters to single occurrence (via do shell script?)
- From: Joseph Weaks <email@hidden>
- Date: Fri, 25 Mar 2005 01:15:43 -0600
I want to clean up a string by reducing all double, triple, etc. spaces
to a single space.
I know how to do it with text item delimiters with something like:
set theString to "This has extra spaces.
I want them removed."
repeat
if theString contains " " then
set Applescript's text item delimiters to " "
set theString to text items of theString
set Applescript's text item delimiters to " "
set theString to theString as string
else
exit repeat
end if
end repeat
But, would a do shell script method be faster? Isn't there a one-liner
perl command that would reduce multiple occurrences of a character to a
single occurrence?
TIA,
Joe Weaks
_______________________________________________
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