MACSCRPT Archives

September 2009

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
Macintosh Scripting Systems <[log in to unmask]>
Mime-version:
1.0
Date:
Wed, 9 Sep 2009 09:46:12 -0700
Reply-To:
Macintosh Scripting Systems <[log in to unmask]>
Content-type:
text/plain; charset="US-ASCII"
Subject:
From:
"Stockly, Ed" <[log in to unmask]>
In-Reply-To:
Content-transfer-encoding:
7bit
Parts/Attachments:
text/plain (23 lines)
 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

ATOM RSS1 RSS2