匹配两个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 + "-----------------"); }
相关文章推荐
- 两个表中多个字段相同,查询一个中有在另一个表中没有的数据
- mysql 连接查询指的是将两张表或多张表关联到一起进行查询,获取一个表的行与另一个表的行匹配的数据。常见的连接查询包括内连接(等值连接)、左(外)连接、右(外)连接和交叉连接(完全连接)等
- 两个文件,按照一个文件中的某一列筛选另一个文件中的数据
- MYSQL查询~ 存在一个表而不在另一个表中的数据
- sql查询模糊匹配Like的没数据一个问题
- (数据库篇) SQL查询~ 存在一个表而不在另一个表中的数据
- SQL查询~ 存在一个表而不在另一个表中的数据
- MySQL查询在一个表而不在另一个表中的数据
- 从两个有序文件中读取数据并有序存到另一个文件中
- mysql查询一个表的数据插入另一个表的写法
- SQL查询存在一个表而不在另一个表中的数据
- oracle数据库中查询一个表中的字段是否存在于另一个表中字段数据
- Mysql 查询一个字符串Id在另一个表中的数据
- 将一个字段的两个数据分开读取
- 一个asp文件如何同时读取两个数据…
- mysql正则匹配解决查询一个字段是否在另一个字段中
- python 从两个配置文件读取数据,形成一个url思路代码
- sqlserver 两个数据库中表的结构不同,如何把一个表中的数据导入到另一个表中
- (数据库篇) SQL查询~ 存在一个表而不在另一个表中的数据
- SQL查询~ 存在一个表而不在另一个表中的数据