所以我有3名数组列表和它们都具有相同的尺寸,我想将它们打印在一个Excel文件,但工作在IP和GEO只在返回的第一个值并结束。使用多个阵列嵌套循环列出
这是我的代码:
for (String url : IPGrabber.URLArray) {
Row row = sheet.createRow(rownum++);
row.createCell(0).setCellValue(url);
for (String ip : IPGrabber.IPArray) {
row.createCell(1).setCellValue(ip);
}
for (String geo : GEOLookup.GEOArray) {
row.createCell(2).setCellValue(geo);
}
}
这是Excel
http://www.google.com 199.59.148.82 United States
http://www.google.com 199.59.148.82 United States
http://www.mcbay.net 199.59.148.82 United States
http://www.facebook.com 199.59.148.82 United States
http://twitter.com 199.59.148.82 United States
输出正如你可以看到URLArray和IPArray是repeatign相同的值
任何帮助将是很大的赞赏尝试了许多不同的方法。
工作完美!谢谢 :) – TehBawz