Это можно сделать следующим образом:
List<String> teamA = Arrays.asList(
"Virgil van Dijk", "Steven Gerrard", "Edilson Cavani", "Lionel Messi");
List<String> teamB = Arrays.asList(
"Paul Pogba","Neymar Jr","Roberto Firmino","Fernando Torres", "Cristiano Ronaldo");
File teamFile = new File("teams.txt");
try (BufferedWriter writer = new BufferedWriter(new FileWriter(teamFile))) {
for (int i = 0, n = Math.max(teamA.size(), teamB.size()); i < n; i++) {
String line = String.format("%-20s\t%-20s",
i < teamA.size() ? teamA.get(i) : "",
i < teamB.size() ? teamB.get(i) : "");
writer.write(line.stripTrailing()));
writer.write("\n");
}
writer.flush();
}
Вывод файла (только для игроков):
Virgil van Dijk Paul Pogba
Steven Gerrard Neymar Jr
Edilson Cavani Roberto Firmino
Lionel Messi Fernando Torres
Cristiano Ronaldo