Mime-Version: |
1.0 |
Sender: |
|
Subject: |
|
From: |
|
Date: |
Thu, 10 Sep 2009 20:31:05 -0400 |
Content-Type: |
text/plain |
Content-Transfer-Encoding: |
quoted-printable |
Reply-To: |
|
Parts/Attachments: |
|
|
Thanks for the help, this is what I ended up using:
set myShell to "egrep '^(696\\||873\\||981\\|)' " & quoted form of myFile
It works, and I think I even know why.
The \| is used by the shell to indicate a pipe is part of the string, right? With out it
numbers like 696123| would also be returned (the \\ is needed to tell applescript that \ is
part of the shell script)
The second | is used as an or , right? Which allows me to send multiple strings in the
same egrep command.
As for efficiency, it takes about 7 seconds to search an entire file returning a few hundred
matches to a single pattern and it take about 7 seconds to search an entire file returning
a few thousand matches to 100+ patterns.
So now I will write the results to a new file, then grep a pattern from that file that
matches the third delimited item.
Piece of cake, right?
ES
|
|
|