import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
public class QueryAnalysis {
public static HashMap<String,String> readFile(String filename){
HashMap<String,String>tagedData=
new HashMap<String,String>();
Workbook wb=
null;
Cell cell=
null;
StringBuffer sb=
new StringBuffer();
try {
File f=
new File(filename);
InputStream
in=
new FileInputStream(f);
wb=Workbook.getWorkbook(
in);
Sheet s=wb.getSheet(
0);
String key=
null;
for(int i=
1;i<s.getRows();i++){
for(int j=
0;j<s.getColumns();j++){
if(j==
1){
cell=s.getCell(j, i);
key=cell.getContents();
}
if(j!=
0&&j!=
3){
cell=s.getCell(j, i);
sb.append(cell.getContents());
}
}
tagedData.put(key, sb.toString());
}
}
catch (FileNotFoundException e) {
e.printStackTrace();
}
catch (BiffException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
return tagedData;
}
public static void main(String[] args) {
HashMap<String,String>tagedData=readFile(
"D://input.xls");
System.out.println(tagedData.size());
}