On Sun, Aug 22, 2004 at 02:35:14PM -0500, Lance Hoffmeyer wrote:
> I would like to write a script that will select N number of
> random lines in a file. Any suggestions on how to do this?
This program has the advantage that it doesn't read the whole file into
memory, which is important if the fil
On Sun, Aug 22, 2004 at 09:16:37PM +0100, Thomas Adam wrote:
> On Sun, Aug 22, 2004 at 04:11:39PM -0400, Travis Crump wrote:
>
> > That only prints one line whenever the second range number is less than
> > the first[which happens roughly half the time][ignoring the fact that
> > ./foo should a
On Sun, Aug 22, 2004 at 02:35:14PM -0500, Lance Hoffmeyer wrote:
> Hello all,
>
> I would like to write a script that will select N number of
> random lines in a file. Any suggestions on how to do this?
>
>
> Lance
Hi Lance,
any language preference? C,perl, bash? there are 1x 10^6 ways.
Is this
On Sunday 22 August 2004 20:40, Lance Hoffmeyer wrote:
> Hello all,
>
> I would like to write a script that will select N number of
> random lines in a file. Any suggestions on how to do this?
I can't guarantee that this is the best approach, but I would write a
small Perl program. If you don'
Lance Hoffmeyer <[EMAIL PROTECTED]> writes:
> Hello all,
>
> I would like to write a script that will select N number of
> random lines in a file. Any suggestions on how to do this?
bogosort -n file | head -N
.Henrik
--
Henrik Christian Grove
[EMAIL PROTECTED]
Systems administrator
--
To
On Sun, Aug 22, 2004 at 04:11:39PM -0400, Travis Crump wrote:
> That only prints one line whenever the second range number is less than
> the first[which happens roughly half the time][ignoring the fact that
> ./foo should also be $FILE].
Yeah, it's not perfect, but it was just off the top of
On Sun, Aug 22, 2004 at 02:35:14PM -0500, Lance Hoffmeyer wrote:
> Hello all,
>
> I would like to write a script that will select N number of
> random lines in a file. Any suggestions on how to do this?
>
> Lance
One way:
- Count lines in file
- Pick N line numbers
- Show file, filtering out u
Thomas Adam wrote:
On Sun, Aug 22, 2004 at 02:35:14PM -0500, Lance Hoffmeyer wrote:
Hello all,
I would like to write a script that will select N number of
random lines in a file. Any suggestions on how to do this?
Here's one that prints random lines of files, ensuring not to overshoot the
known l
On Sun, 2004-08-22 at 20:35, Lance Hoffmeyer wrote:
> Hello all,
>
> I would like to write a script that will select N number of
> random lines in a file. Any suggestions on how to do this?
>
Use the rand() function in awk
--
Oliver Elphick [EMAIL PROT
On Sun, Aug 22, 2004 at 02:35:14PM -0500, Lance Hoffmeyer wrote:
> Hello all,
>
> I would like to write a script that will select N number of
> random lines in a file. Any suggestions on how to do this?
Here's one that prints random lines of files, ensuring not to overshoot the
known length of t
10 matches
Mail list logo