Skip to content

Instantly share code, notes, and snippets.

@GaetanoPiazzolla
Last active May 13, 2021 07:40
Show Gist options
  • Save GaetanoPiazzolla/8f4cea9816fe552d0a7869ba40d586d7 to your computer and use it in GitHub Desktop.
Save GaetanoPiazzolla/8f4cea9816fe552d0a7869ba40d586d7 to your computer and use it in GitHub Desktop.
List<String> bigList = Arrays.asList("1","2"....."6000")
for (int i = 0; i < bigList.size(); i++) {
String tokenToSearch = bigList.get(i);
if (i % 100 == 0) {
if (i != 0) {
bufferedWriter.close();
}
outputStream = new FileOutputStream("result" + i + ".txt");
outputStreamWriter = new OutputStreamWriter(outputStream, "UTF-8");
bufferedWriter = new BufferedWriter(outputStreamWriter);
}
// rest calls....
bufferedWriter.write(tokenToSearch + "," + resultYouNeeed);
bufferedWriter.newLine();
}
@GaetanoPiazzolla
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment