On Thu, Sep 17, 2009 at 8:14 PM, [log in to unmask] <[log in to unmask]> wrote:
> I'm thinking there's a way to run tr on a file, have the result
> in memory, then egrep that to get the desired results, but I'm not there
> yet.

That'd be a "pipe".  And tr and egrep run in parallel, so there's no
delay and no need for a big memory buffer.  tr writes a line of
output, egrep reads a line of input, repeat.


do shell script "tr '\\r' '\\n' " & quoted form of pathName & " |
egrep " & quoted form of regExp

Note that you just don't supply a filename to egrep at all; it
automatically reads from its standard input in that case, which the
shell has attached to the pipe.

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