extract excel on column in two lines of code

Key wordsparse excel  structured excel

General method: use a third-party class library (POI or HSSFWorkbook, etc.) to read the sheet and cell information of the excel file, traverse cells to read desired data according to the rules, and structure the table data. However, due to the lack of rich function class library of the program language, hard coding is still needed, and the workload will be relatively large.

It would have been much simpler to deal with such problems if you had used esProc SPL. It can easily read Excel files and structure the table data. For example, the content of the file item.xlsx is as follows:

undefined

The structured effect is shown as follows:

undefined

To deal with the above problem, esProc SPL only needs 2 lines, and the code is as follows:


A

1

=file("item.xlsx").xlsimport(;1,5)

2

=A1.rename(#1:No,#2:ItemCode,#3:ItemName,#4:Unit,#5:Quantity,#6:Price,#7:Sum)

In fact, there are many similar structured problems, and it will be very simple to use esProc SPL. Please refer to Parsing and Exporting Excel Data in SPL.

esProc is also a professional tool for file data source processing. It can easily perform mixed calculation, importing into and exporting out of database of various file data, such as TXT, Excel, XML, JSON, CSV, ini, etc.

A desktop computing tool, esProc is ready to use, with simple configuration and complete debugging functions: breakpoints and single step execution can be set, and the result of each step can be viewed. The syntax is simple, in line with people's natural thinking, and simpler than other advanced development languages. Please refer to: http://www.raqsoft.com/html/file-processor.html

esProc is integration-friendly. Read How to Call an SPL Script in Java to see how we can easily embedded an SPL script into a Java program.

Read Getting Started with esProc to download and install esProc, get a license for free and find related documentation.