quick & dirty:

 Code:
break on

global $RandomCallCounter

$Array = RandomizeArray(ReadFile("\\path\to\infile.txt"))

$arraysize = ubound($array) + 1

? "The array contains "+$arraysize+" elements.  How many do you want to pick? "
gets $howmany

$ = open(1,"\\path\to\newfile.txt",5)

for $x = 1 to ($howmany)
    $ = WRITELINE(1,$Array[$x]+@CRLF)
next

$ = close(1)


This relies on the ReadFile() and RandomizeArray() UDFs, both of which can be found in the UDF forum. May not be the neatest way, but it'll get the job done.


Edited by eriqjaffe (2008-12-12 03:57 PM)