MACSCRPT Archives

November 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:
"Mark J. Reed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 4 Nov 2009 11:41:06 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (38 lines)
Ed: was this a repeat from a different thread?  Did you make sure the
file has UNIX line endings?

On Wed, Nov 4, 2009 at 11:22 AM, [log in to unmask] <[log in to unmask]> wrote:
>  Thanks all for the advice.  That part of the script is working, but I'm a
> bit concerned because I don't think I could debug it if something goes
> wrong.  But what could go wrong?
>
> Well, now that I have the list of numbers I need to use them to extract
> lines from various files that are in pipe delimited format.Each number is
> unique and only appears in one line of the file.
>
>
> The problem is when I run either of the scripts below the result is every
> single line of the file.
>
>
> set thePattern to
> "\\|4571100\\||12245332\\||7519636\\||4824164\\||2971399\\||925639\\||"
> set myShellScript to "egrep " & quoted form of thePattern & " " & quoted
> form of programFile
> set myOutput to do shell script myShellScript
>
> set thePattern to "\\|4571100\\||"
> set myShellScript to "egrep " & quoted form of thePattern & " " & quoted
> form of programFile
> set myOutput to do shell script myShellScript
>
> Any ideas what I'm doing wrong?
>
> ES
>



-- 
Mark J. Reed <[log in to unmask]>

ATOM RSS1 RSS2