我有 14 个列表,每个列表都有数字或字符串数据。每个列表的大小为 32561。我必须输出一个格式为:
list1_element1 list2_element1.......................list14_element1
list1_element2 list2_element2.......................list14_element2
.
.
.
.
.
list1_element32561 list2_element32561.......................list14_element32561
输出文件中的每个元素都由制表符分隔。我在Java中这样做了。
out = new BufferedWriter(new FileWriter(fileName));
for(int i=0; i<32561; i++) {
out.write(firstList.get(i));
out.write("\t");
out.write(secondList.get(i));
out.write("\t");
out.write(thirdList.get(i));
out.write("\t");
out.write(fourthList.get(i));
out.write("\t");
out.write(fifthList.get(i));
out.write("\t");
out.write(sixthList.get(i));
out.write("\t");
out.write(seventhList.get(i));
out.write("\t");
out.write(eighthList.get(i));
out.write("\t");
out.write(ninthList.get(i));
out.write("\t");
out.write(tenthList.get(i));
out.write("\t");
out.write(eleventhList.get(i));
out.write("\t");
out.write(twelvethList.get(i));
out.write("\t");
out.write(thirteenthList.get(i));
out.write("\t");
out.write(fourteenthList.get(i));
out.write("\t");
out.write(fifteenthList.get(i));
out.newLine();
}
}
我的程序仅打印 32441 行,最后一行仅包含 6 列。我不明白为什么。有人可以帮忙吗?