Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Assume I have 4 inputs (input 1, 2,3 and 4) I need to create csv files which contain randomly selected rows from each input so that each row/record is only in 1 csv file and all rows/records are used.
My initial thought is to find the number of rows in each input and select the smallest value (call it X). Using that I would assign a random number to each row in each input between 1 and X and then aggregate the rows by the random number.
Anyone have any other ideas ?
I found this code for random numbers in this forum post which I hope could be reused to find the next int between 1 and X
java.util.Random (package) // for generating random number for the range b\w 0000 to 9999 int randomInt = randomGenerator.nextInt(9999)
If a big random number was added to each of the 4 inputs and then the inputs merged before sorting wouldn't there be a possibility that 100 rows you write might not contain rows from each of the inputs?
Can you explain more about
row counter
you mention? is it a component or a setting or code?
I dont know your data distribution, however regarding a sample based on specific value look at pics and also added the job:
Note: wijk is dutch for area