Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diff failed: Failed to read as excel file: #20

Open
toobaz opened this issue May 14, 2015 · 4 comments
Open

Diff failed: Failed to read as excel file: #20

toobaz opened this issue May 14, 2015 · 4 comments

Comments

@toobaz
Copy link

toobaz commented May 14, 2015

As reported in a comment to this answer, ExcelCompare is failing on a regular xls file with the following error message:

Diff failed: Failed to read as excel file: problema.xls

The file opens regularly in LibreOffice, and is parsed fine by the xlrd python library.

Unfortunately this is not a file I can post publicly, and if I open it (with LibreOffice) and "Save as" a new file the problem already disappears (so I cannot censor sensitive parts). I have no access to the computer where the file was produced.

Feel free to let me know if there is something I can do to debug the issue. This is what the command "file" says of this file:

problema.xls: Composite Document File V2 Document, Little Endian, Os: Windows, Version 4.10, Code page: 1252, Last Saved Time/Date: Thu Jan  8 19:06:04 2015

(and this is what it says after resaving with LibreOffice:

problema2.xls: Composite Document File V2 Document, Little Endian, Os: Windows, Version 1.0, Code page: -535, Revision Number: 0, Last Saved Time/Date: Thu Jan  8 19:06:04 2015

)

@na-ka-na
Copy link
Owner

Thanks for reporting. Without the file it'll be pretty hard to debug. But if you think the tool will be useful to you - I can try to create a debug binary - which will print out useful messages to debug and hopefully I can fix the issue looking at those. Lemme know if you think this is something worth doing.

@toobaz
Copy link
Author

toobaz commented May 14, 2015

I actually don't need the program any more - my need for Excel diffing was very short lived. That said, I can test a debug binary if you think the resulting messages would be valuable to you.

@na-ka-na
Copy link
Owner

I added a --debug flag, it will generate a stack trace, can you paste that? run as: excel_cmp --debug . download release here: https://github.com/na-ka-na/ExcelCompare/releases/download/0.5.1/ExcelCompare-0.5.1.zip

@toobaz
Copy link
Author

toobaz commented Jul 20, 2015

Here it is:

    pietro@debiousci:~/cancellami/qv$ excel_cmp --debug problema.xls problema.xls 
    java.lang.RuntimeException: Failed to read as excel file: problema.xls
        at com.ka.spreadsheet.diff.SpreadSheetDiffer.loadSpreadSheet(SpreadSheetDiffer.java:256)
        at com.ka.spreadsheet.diff.SpreadSheetDiffer.doDiff(SpreadSheetDiffer.java:132)
        at com.ka.spreadsheet.diff.SpreadSheetDiffer.doDiff(SpreadSheetDiffer.java:102)
        at com.ka.spreadsheet.diff.SpreadSheetDiffer.main(SpreadSheetDiffer.java:90)
    Caused by: java.lang.RuntimeException: Unexpected missing row when some rows already present
        at org.apache.poi.hssf.usermodel.HSSFSheet.setPropertiesFromSheet(HSSFSheet.java:212)
        at org.apache.poi.hssf.usermodel.HSSFSheet.<init>(HSSFSheet.java:137)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:338)
        at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:115)
        at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:206)
        at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:188)
        at com.ka.spreadsheet.diff.SpreadSheetDiffer.loadSpreadSheet(SpreadSheetDiffer.java:241)
        ... 3 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants