所以,我有这种情况:我有两个 .csv 文件,我需要读取和保存它们的数据。
问题在这里:
while ((nextPM = csvReader2.readNext()) != null) {
System.out.println(nextPM[0]);
while ((nextRecord = csvReader.readNext()) != null) {
System.out.println(nextRecord[0] + "asd");
if(nextRecord[0].equals(nextPM[0])) {
System.out.println(nextRecord[0] + " " + nextRecord[1] + " " + nextPM[2]);
}
}
}
第一次完美运行,但是当第一个 while 循环再次开始时,第二个 while 将被跳过。有什么解决办法吗?当然nextPM并且nextRecord是String[](在我向您展示的代码之外初始化)
慕桂英546537
慕运维8079593
慕后森
相关分类