91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 11.71MB
    文件類型: .rar
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2023-06-29
  • 語言: Java
  • 標(biāo)簽: java??poi??excel??

資源簡介

一個解單的java工程,利用poi解析excel.下載代碼直接可以運(yùn)行。

資源截圖

代碼片段和文件信息

package?util;

import?java.io.BufferedReader;
import?java.io.File;
import?java.io.FileInputStream;
import?java.io.FileNotFoundException;
import?java.io.FileOutputStream;
import?java.io.IOException;
import?java.io.InputStream;
import?java.io.InputStreamReader;
import?java.io.PrintWriter;
import?java.util.ArrayList;
import?java.util.List;

import?org.apache.poi.hssf.usermodel.HSSFWorkbook;
import?org.apache.poi.ss.usermodel.Cell;
import?org.apache.poi.ss.usermodel.Row;
import?org.apache.poi.ss.usermodel.Sheet;
import?org.apache.poi.ss.usermodel.Workbook;
import?org.apache.poi.xssf.usermodel.XSSFWorkbook;

public?class?ExcelUtil?{

private?static?String?tempFirstFilePath?=?“C:/更新品牌編碼.txt“;
private?static?String?tempSecondFilePath?=?“C:/更新品牌編碼和名稱.txt“;

public?static?void?main(String[]?args)?{
????????Workbook?wb?=null;
????????Sheet?sheet?=?null;
????????Row?row?=?null;
????????//List>?list?=?null;
????????List?list?=?null;
????????String?firstData?=?null;
????????String?secondData?=?null;
????????String?threeData?=?null;
????????String?fourData?=?null;
????????String?filePath?=?“D:\\test.xlsx“;
???????//?String?columns[]?=?{“first““second““three““four“};
????????wb?=?readExcel(filePath);
????????if(wb?!=?null){
????????????//用來存放表中數(shù)據(jù)
????????????//list?=?new?ArrayList>();
???????? list?=?new?ArrayList();
????????????//獲取第一個sheet
????????????sheet?=?wb.getSheetAt(0);
????????????//獲取最大行數(shù)
????????????int?rownum?=?sheet.getPhysicalNumberOfRows();
????????????//獲取第一行
????????????row?=?sheet.getRow(0);
????????????//獲取最大列數(shù)
????????????int?colnum?=?row.getPhysicalNumberOfCells();
????????????for?(int?i?=?1;?i????????????????//Map?map?=?new?linkedHashMap();
???????????? TempBean?bean?=?new?TempBean();
????????????????row?=?sheet.getRow(i);
????????????????if(row?!=null){
????????????????????for?(int?j=0;j???????????????????? firstData?=?(String)?getCellFormatValue(row.getCell(0));//舊編碼
???????????????????? secondData?=?(String)?getCellFormatValue(row.getCell(4))?+?(String)?getCellFormatValue(row.getCell(7));//新編碼,由新規(guī)格編碼+卷煙新版型
????????????????????????threeData?=?(String)?getCellFormatValue(row.getCell(4));//新規(guī)格編碼(6位)
????????????????????????fourData?=?(String)?getCellFormatValue(row.getCell(5));//新規(guī)格名稱
????????????????????????bean.setFirst(firstData);
????????????????????????bean.setSecond(secondData);
????????????????????????bean.setThree(threeData);
????????????????????????bean.setFour(fourData);
???????????????????? //map.put(columns[0]+“_“+i?firstData);
????????????????????????//map.put(columns[1]+“_“+i?secondData);
????????????????????????//map.put(columns[2]+“_“+i?threeData);
????????????????????????//map.put(columns[3]+“_“+i?fourData);
????????????????????}
????????????????}else{
????????????????????break;
????????????????}
????????????????//list.add(

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件????????469??2019-04-25?11:36??Test\.classpath

?????文件???????1037??2019-04-25?11:31??Test\.project

?????文件????????567??2019-04-25?11:31??Test\.settings\.jsdtscope

?????文件?????????72??2019-04-26?10:15??Test\.settings\org.eclipse.core.resources.prefs

?????文件????????598??2019-04-25?11:30??Test\.settings\org.eclipse.jdt.core.prefs

?????文件????????454??2019-04-25?11:31??Test\.settings\org.eclipse.wst.common.component

?????文件????????252??2019-04-25?11:31??Test\.settings\org.eclipse.wst.common.project.facet.core.xml

?????文件?????????49??2019-04-25?11:31??Test\.settings\org.eclipse.wst.jsdt.ui.superType.container

?????文件??????????6??2019-04-25?11:31??Test\.settings\org.eclipse.wst.jsdt.ui.superType.name

?????文件??????????0??2019-05-07?09:29??Test\bin\config\jdbc.properties

?????文件???????7079??2019-05-07?09:02??Test\bin\util\ExcelUtil.class

?????文件???????3190??2019-04-28?09:04??Test\bin\util\JdbcUtil.class

?????文件???????5016??2019-04-28?09:04??Test\bin\util\MD5.class

?????文件???????3224??2019-04-28?17:08??Test\bin\util\TempBean.class

?????文件??????????0??2019-05-07?09:29??Test\src\config\jdbc.properties

?????文件??????11576??2019-05-07?09:02??Test\src\util\ExcelUtil.java

?????文件???????2987??2019-03-30?09:55??Test\src\util\JdbcUtil.java

?????文件???????6129??2019-03-30?09:55??Test\src\util\MD5.java

?????文件???????2523??2019-04-28?17:08??Test\src\util\TempBean.java

?????文件?????????39??2019-04-25?11:31??Test\WebContent\meta-INF\MANIFEST.MF

?????文件??????47983??2019-02-26?16:22??Test\WebContent\WEB-INF\lib\db2dbgm.jar

?????文件?????870217??2019-02-26?16:22??Test\WebContent\WEB-INF\lib\db2java.jar

?????文件????2109253??2019-02-26?16:22??Test\WebContent\WEB-INF\lib\db2jcc.jar

?????文件??????23709??2019-02-26?16:22??Test\WebContent\WEB-INF\lib\db2jcc_javax.jar

?????文件???????1015??2019-02-26?16:22??Test\WebContent\WEB-INF\lib\db2jcc_license_cu.jar

?????文件?????118328??2019-02-26?16:22??Test\WebContent\WEB-INF\lib\db2policy.jar

?????文件?????170472??2019-02-26?16:22??Test\WebContent\WEB-INF\lib\db2qgjava.jar

?????文件???????9095??2019-02-26?16:22??Test\WebContent\WEB-INF\lib\db2umplugin.jar

?????文件?????313898??2019-04-26?09:50??Test\WebContent\WEB-INF\lib\dom4j-1.6.1.jar

?????文件????1869113??2019-04-25?14:54??Test\WebContent\WEB-INF\lib\poi-3.9.jar

............此處省略19個文件信息

評論

共有 條評論