J
J
Jsman2016-02-10 14:06:57
Java
Jsman, 2016-02-10 14:06:57

How to fix the error (parsing xls)?

Good afternoon! There is a task to parse xls. Everything seems to be fine and I have already done this more than once, I use the apache.poi library.
Three lines of code

HSSFWorkbook xlsxFile = new HSSFWorkbook(new FileInputStream("../отчет.xls"));
        HSSFSheet xlsxList = xlsxFile.getSheet("Лист1");
            System.out.println(xlsxList.getRow(10).getCell(0));

And then an exception occurs:
"Exception in thread "main" java.lang.RuntimeException: Unexpected missing row when some rows already present"
I roughly understand that xls is unusual and there are cut cells, combined cells / rows, but I don’t understand how to overcome this error.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2016-02-10
@dimonchik2013

Well, how do they usually fight? Java, on the other hand, will not give birth to data, if they are not there
, weed out problematic lines, parse them manually

A
Arthur, 2016-02-10
@antoart

And the given error manifests itself only with a specific column? Only with the 10th?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question