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

[REBOL] Re: Line reduction

From: joel:neely:fedex at: 7-Jul-2001 2:28

Footnote: It helps to be able to make up one's mind!!! Joel Neely wrote:
> source-file: to-file ask "Source file name: " > output-file: to-file ask "Output file name: " > > sample-pct: 0.01 * > min 100 max 0 to-decimal ask "% of data to sample: " > > line-count: length? all-the-data: read/lines to-file source-file > > write/lines to-file output-file > at all-the-data > to-integer line-count - (line-count - 1 * sample-pct) + 0.5 >
As I played with the above, I kept waffling about whether to apply TO-FILE at the point of ASK or at the point of use. Clearly I failed to make the last switch complete! (But, applying TO-FILE twice is preferable to not at all. ;-) -jn- --------------------------------------------------------------- There are two types of science: physics and stamp collecting! -- Sir Arthur Eddington joel-dot-neely-at-fedex-dot-com