in reply to Re: Re: Re: Random entry from combined data set
in thread Random entry from combined data set

Only if the lines are uniformly long, or you have an index to the beginning of each line. The "select a random starting byte" will unfairly bias the lines based on their size (or the size of the line ahead or behind them depending on the algorithm).

-- Randal L. Schwartz, Perl hacker

  • Comment on Re: Re: Re: Re: Random entry from combined data set

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Random entry from combined data set
by I0 (Priest) on Jul 05, 2001 at 02:35 UTC
    I did not suggest "select a random starting byte"
    I suggested "select a random starting file" (If the number lines in each file is known in advance)
    Then "Select a random line" from that file.