Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does Apache-HSSF modify, read and write documents?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Apache-HSSF to modify the document reading and writing is how, many novices are not very clear, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

I. Overview of HSSF

HSSF is the abbreviation of Horrible SpreadSheet Format. With HSSF, you can read, write, and modify Excel files with pure Java code. HSSF provides two types of API:usermodel and eventusermodel for read operations, namely, "user model" and "event-user model".

II. Poi excel document structure

HSSFWorkbook excel document object

Sheet of HSSFSheet excel

HSSFName name

HSSFHeader sheet's head.

The line of HSSFRowexcel

The tail of HSSFFooter sheet

The cell of HSSFCell excel

The style of HSSFCellStyle cell

HSSFFont excel font

HSSFDataFormat date format

3. Import the excel//excel file location String readfilePath= "f:\\ 2019-04-23 22_53_44____.xls"; / / create a reference to the excel file HSSFWorkbook workbook=new HSSFWorkbook (new FileInputStream (readfilePath)) / / get the first HSSFSheet sheet=workbook of sheet. GetSheetAt (0); / / get the line cellHSSFRow row=sheet.getRow (1); / / get the line end position int colCount=sheet.getRow (0). GetLastCellNum (); / / traverse the for (int job1witj)

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report