I need to sample rows from file (file is too big to load to memory). I have this snipper using BufferedReader:
BufferedReader br = new BufferedReader(new FileReader(filename));
String line;
long counter = 0;
while ((line = br.readLine()) != null && DocCounter < 50000) {}
How can I adjust the code to sample randomly 50000 rows from the file ? thanks