Sender: |
|
Date: |
Thu, 10 Sep 2009 00:24:41 +0200 |
MIME-version: |
1.0 |
Reply-To: |
|
Content-type: |
text/plain; charset=US-ASCII; format=flowed; delsp=yes |
Subject: |
|
From: |
|
In-Reply-To: |
|
Content-transfer-encoding: |
7BIT |
Parts/Attachments: |
|
|
1. As Mark says, you probably want the unescaped pipes.
2. You don't say the speed of your hard disk, but probably reading is
far slower than grepping, so I would advise the pipes rather than the
loop.
3. Don't forget to specify a case-sensitive search, it's much faster.
Emmanuel
On Sep 9, 2009, at 6:46 PM, Stockly, Ed wrote:
> Hi, I have a rather large file (1 gig+) that contains pipe delimited
> data.
>
> I'm running a shell script from AppleScript that pulls every line that
> begins with a particular string.
>
> Do shell script "Grep ^" & foo & "\|" & myFile
>
> Takes a while, but it works.
>
> Often I have to extract several matches, and I'm wondering if it's
> possible
> to something like this:
>
> Do shell script "Grep ^" & foo & "\| ^" & foo1 & "\| ^" & foo2 & "\|
> ^" &
> foo7 & "\|" myFile
> --doesn't work and I've tried numerous variations
>
> The result would be any lines that begin with any of those strings.
>
> Then, if that is possible, the next question would be is that more
> efficient
> than repeat through a loop for larger numbers of items (100+)?
>
> ES
|
|
|