Copying random lines from txt file w/o duplicates - 24/05/06 12:32 AM
I'm back for more help, yet again.
What I need is an efficient way to copy six random lines from one text file into another while ensuring that none of the lines are duplicates of each other.
A possible solution I thought of would involve using $rand() and storing six values generated, then comparing each of the six values to make sure that none are equal before using $read() off the values that were stored. Seems like there might be a better method, though.
What I need is an efficient way to copy six random lines from one text file into another while ensuring that none of the lines are duplicates of each other.
A possible solution I thought of would involve using $rand() and storing six values generated, then comparing each of the six values to make sure that none are equal before using $read() off the values that were stored. Seems like there might be a better method, though.