Re: Strip characters without recursive loop
Re: Strip characters without recursive loop
- Subject: Re: Strip characters without recursive loop
- From: Emmanuel <email@hidden>
- Date: Tue, 19 Aug 2003 16:13:30 +0200
At 10:20 AM +0200 19/08/03, Jean-Baptiste LE STANG wrote:
>
Using satimage osax, you can do :
>
>
change "[^(1-9)]" into "" in "aze213aze456" with regexp
>
--> "213456"
>
@+ JB
(probably you would choose to include "0" as well)
Emmanuel
>
>On Tuesday, August 19, 2003, at 01:52 PM, Duncan Cowan wrote:
>
>>Is it possible to string all non numerical characters from a string, without
>
>>looping through each character?
>
>>I realise that this is probably not possible.... but it would make my script
>
>>run a lot quicker.
>
>>Example:
>
>>set theString to "1234-56abc"
>
>>set theResult to characters of the string whose kind is integer
>
>>
>
>
>
>well, I don't know if it's faster than your particular loop but
>
>
>
>set theString to "1234-56abc"
>
>set theStringVersion2 to quoted form of theString
>
>set shellstring to "echo " & theStringVersion2 & " |sed 's/[^0123456789]//g'"
>
>set theResult to do shell script shellstring
>
>
>
>seems to work,
>
>
>
>
>
>David Hood
>
>_______________________________________________
>
>applescript-users mailing list | email@hidden
>
>Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
>
>Do not post admin requests to the list. They will be ignored.
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.