5

Randomly draw a certain number of lines from a data file

view full story
linux-howto

http://unix.stackexchange.com – I have a data list, like 12345 23456 67891 -20000 200 600 20 ... Assume the size of this data set (i.e. lines of file) is N. I want to randomly draw m lines from this data file. Therefore, the output should be two files, one is the file including these m lines of data, and the other one includes N-m lines of data. Is there a way to do that using a Linux command? (HowTos)