In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, the editor will bring you how to read and import Java's poi technology into Excel. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.
Project structure:
The Excel file used:
XlsMain .java class
/ / this class has a main method, which is mainly responsible for running the program, and it also contains reading Excel with poi (version 2003).
Import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook / * @ author Hongten * * reference address: http://hao0610.iteye.com/blog/1160678 * * / public class XlsMain {public static void main (String [] args) throws IOException {XlsMain xlsMain = new XlsMain (); XlsDto xls = null; List list = xlsMain.readXls () Try {XlsDto2Excel.xlsDto2Excel (list);} catch (Exception e) {e.printStackTrace ();} for (int I = 0; I < list.size (); iTunes +) {xls = (XlsDto) list.get (I) System.out.println (xls.getXh () + "+ xls.getXm () +" + xls.getYxsmc () + "+ xls.getKcm () +" + xls.getCj ()) }} / * read xls file contents * * @ return List object * @ throws IOException * input / output exception * / private List readXls () throws IOException {InputStream is = new FileInputStream ("pldrxkxxmb.xls"); HSSFWorkbook hssfWorkbook = new HSSFWorkbook (is) XlsDto xlsDto = null; List list = new ArrayList (); / / Circular worksheet Sheet for (int numSheet = 0; numSheet < hssfWorkbook.getNumberOfSheets (); numSheet++) {HSSFSheet hssfSheet = hssfWorkbook.getSheetAt (numSheet); if (hssfSheet = = null) {continue } / / Loop line Row for (int rowNum = 1; rowNum
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.