Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Processing files / Any AWK users?

From: tomc:darkwing:uoregon at: 18-Nov-2001 21:00

On Sun, 18 Nov 2001, Gregg Irwin wrote:
> If I'm processing a file, by lines, thus: > > foreach line read/lines/with file rec-sep [ > > It appears that foreach doesn't call read on each pass, but I thought I'd > ask to see if anyone knows, for certain. I know you can modify the block > that foreach uses and it will see the changes, but I wasn't sure what magic > occurs in this scenario. > > The real question, I suppose, is: Should I cache the return value from 'read > before using it with foreach, or is that unnecessary?
I do this alot, and have worked with the assumption that it is best (metric: [walltime disk-io]) to read once at the beginning and write once at the end, and use as many in-memory buffers as I need inbetween.
> As a side question, does anyone on the list use AWK or think that something > like it (i.e. an auto-driven rule/action file processor) would be useful? >
what is parse not doing?