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]>