MACSCRPT Archives

September 2009

MACSCRPT@LISTSERV.DARTMOUTH.EDU

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

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

Print Reply
Subject:
From:
"Stockly, Ed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 9 Sep 2009 09:46:12 -0700
Content-Type:
text/plain
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