您的位置:首页 > 其它

匹配两个EXCEL表中的数据,即读取一个表中数据在另一个表中查询

2014-04-03 10:21 447 查看
File file = new File("D://2014BYSSY-6.xls");
String[][] a1 = ReadExcel.getData(file, 1);
File file2 = new File("D://校内导入研究生数据.xls");
String[][] a2 = ReadExcel.getData(file2, 1);

int flag = 0;
String temp = "";
for (int i = 0; i < a2.length; i++) {
for (int j = 0; j < a1.length; j++) {
if (a2[i][0].equals(a1[j][3])) {
temp = a1[j][19];
flag = 1;
break;
} else
flag = 0;
}
if (flag == 1)
System.out.println(temp);
else if (flag == 0)
System.out.println(i + "-----------------");
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐