RE: Finding lines containing foo in a file
RE: Finding lines containing foo in a file
- Subject: RE: Finding lines containing foo in a file
- From: "Stockly, Ed" <email@hidden>
- Date: Thu, 22 Dec 2005 15:39:28 -0800
>>Deivy>>I believe that this is faster than an AS solution without do shell
> script.
>
I think you're right, this could be much faster, these files are so big it slows appleScript way down. When I run this command from the terminal it works instantaneously.
Here's the most recent version I've been testing:
<Script>
set AppleScript's text item delimiters to "|"
set itemstofind to quoted form of ({"32103", "31823", "31679"} as string)
set filepath to quoted form of POSIX path of ((choose file) as Unicode text)
set myShellScript to "tr '\\r' '\\n' < " & filepath & " |" & "egrep " & itemstofind
(do shell script myShellScript)
</Script>
Here's the problem, when I run the script I get this error message:
--> Can't make result of «script» into the expected type.
But I can paste the text of the myShellScript variable directly into the terminal and it works flawlessly, reliably with several files and several strings, including not found strings.
Any Suggestions?
ES
_______________________________________________
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