SpringPOI如何应用于长尾词数据提取与分析?
- 内容介绍
- 文章标签
- 相关推荐
本文共计235个文字,预计阅读时间需要1分钟。
javapublic void downloadExcel(InputStream is) throws Exception { Workbook wb=null; try { wb=new HSSFWorkbook(is); Sheet sheet=wb.getSheetAt(0); String sheetName=sheet.getSheetName(); } catch (IOException e) { e.printStackTrace(); } finally { if (wb !=null) { wb.close(); } }}
public void doImport(InputStream is) throws Exception{
//读取工作簿
Workbook wb = null;
try {
wb = new HSSFWorkbook(is);
//得到第一个工作表
Sheet sheet = wb.getSheetAt(0);
//得到 工作表名称
String sheetName = sheet.getSheetName();
String type = "";
if("供应商".equals(sheetName)){
type = Supplier.TYPE_PURCHASE;
}
if("客户".equals(sheetName)){
type = Supplier.TYPE_CUSTOMER;
}
int rowCnt = sheet.getLastRowNum();//最后一行的索引
Row row = null;
for(int i = 1; i <= rowCnt; i++){
row = sheet.getRow(i);
//供应商名称
String name = row.getCell(0).getStringCellValue();
//构建查询条件
Supplier supplier = new Supplier();
//设置查询条件
supplier.setName(name);
List
本文共计235个文字,预计阅读时间需要1分钟。
javapublic void downloadExcel(InputStream is) throws Exception { Workbook wb=null; try { wb=new HSSFWorkbook(is); Sheet sheet=wb.getSheetAt(0); String sheetName=sheet.getSheetName(); } catch (IOException e) { e.printStackTrace(); } finally { if (wb !=null) { wb.close(); } }}
public void doImport(InputStream is) throws Exception{
//读取工作簿
Workbook wb = null;
try {
wb = new HSSFWorkbook(is);
//得到第一个工作表
Sheet sheet = wb.getSheetAt(0);
//得到 工作表名称
String sheetName = sheet.getSheetName();
String type = "";
if("供应商".equals(sheetName)){
type = Supplier.TYPE_PURCHASE;
}
if("客户".equals(sheetName)){
type = Supplier.TYPE_CUSTOMER;
}
int rowCnt = sheet.getLastRowNum();//最后一行的索引
Row row = null;
for(int i = 1; i <= rowCnt; i++){
row = sheet.getRow(i);
//供应商名称
String name = row.getCell(0).getStringCellValue();
//构建查询条件
Supplier supplier = new Supplier();
//设置查询条件
supplier.setName(name);
List

