My system uses Apache-POI to manage some xls files. Now I've got almost 300 xls files, but it appears that they are in an old format so i got this exception:
The supplied spreadsheet seems to be Excel 5.0/7.0 (BIFF5) format. POI only supports BIFF8 format (from Excel versions 97/2000/XP/2003)
Is there a way to handle that or to automatically convert all those files to a biff8 format?
Go with converting it to OOXLS format, POI supports both BIFF8 and newer OOXLS. Download official Microsoft converter pack:
http://www.microsoft.com/en-us/download/details.aspx?id=3
Convert files by running excelcnv.exe -oice <input file> <output file>. You can try run it directly from your code as external program, or create some batch file. There is a good explanation from mrdivo at social msdn here.
EDIT
The download mentioned above from microsoft.com is no longer available as of 6/21/2018. However, excelcnv.exe is a standard part of some Microsoft Office installations. It has been confirmed to be deployed with Office 2014 and Office 2016, and possibly other versions. It can be found at:
C:\Program Files (x86)\Microsoft Office\root\Office16` (or `Office14`).
It seems apache-POI can't handle BIFF5 format.
You should try to use Java Excel API instead : http://jexcelapi.sourceforge.net/
Related
Error -9039: ISSQLScriptFile Table
The conversion process does not support data in the MSI table 'ISSQLScriptFile'.
I don't use SQL scripts much in MSI installers, and I don't have access to Installshield, but please read this: https://docs.revenera.com/installshield26helplib/helplibrary/Citrix9039.htm
Unsure of the context for the error - are you converting an MSI to an ISM? (the latter is an Installshield project file as opposed to a normal MSI installer file - the ISM file is - or at least used to be - an MSI-formatted file in disguise with Installshield-specific tables added).
If you are converting to ISM, maybe you can just remove this table, convert the file successfully and then locate the SQL scripts and re-insert them into the project. I haven't looked at that for years.
I have referred all post in stack overflow related to reading XLSB file using apache POI.
I tried many ways to read XLSB file using available links/example mentioned in post. But I am ended up in issues.
I am using latest Apache POI 3.17 and used the code mentioned in
Link :
Exception reading XLSB File Apache POI java.io.CharConversionException
Section: Post mentioned by "Gagravarr "
I am getting the following errors
The method getLocale() is undefined for the type XSSFBEventBasedExcelExtractor
The method getFormulasNotResults() is undefined for the type XSSFBEventBasedExcelExtractor
The constructor XSSFEventBasedExcelExtractor.SheetTextExtractor() is not visible
The method getIncludeSheetNames() is undefined for the type XSSFBEventBasedExcelExtractor
.......................... etc
I checked the base class "XSSFEventBasedExcelExtractor" in poi-ooxml-3.17.jar (source files) and I can able to find implementation for all the method.
I wanted to know whether this is an known issue ? Does it mean that there is no working example available to read XLSB files in Java.
I hope this query is not duplicate.
Recently, i study how to use poi to read xlsb.
If you just want to read a xlsb purely, you can use the apache test example code as the following.
https://svn.apache.org/repos/asf/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFBReader.java
In fact, xlsb use .bin file instead of .xml file.
If you want to do more thing to xlsb file, you can read this document as the following.
https://msdn.microsoft.com/en-us/library/office/cc313133(v=office.12).aspx
Does anyone know a workaround to make excel files work in SAS when their is a bit discrepancy? My Microsoft office applications are 32 bit, and I have a downloaded version of SAS that I got for free while in school. The problem is that the SAS is 64 bit, and doesn't work with excel files. Is there an easy way to get around this?
If you have SAS 9.4 then you can read and write XLS and XLSX file directly.
Use PROC IMPORT.
proc import datafile='myfile.xlsx' out=mydataset dbms=xlsx ....
Or even a libname.
libname mydata xlsx 'myfile.xlsx';
proc copy inlib=mydata outlib=work; run;
Depending on your version not all features of XLSX are supported. You can download PCFileServer to get around these and use DBMS=EXCELCS. You also have the option of using SAS University Edition for free. Both should be under similar licence, only valid for learning purposes.
I need to parse data from xlsx file. Currently I'm using Jakarta-POI (v. 3.11) to do that. It handles fine some xlsx but not all. I noticed that the files that are not parsed properly are "strict xlsx" files saved with Office 2013. To be more exact this files are compliant with ISO29500 not ECMA-376 the difference is that in ISO29500 file there are relationships with type:
http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument
and Jakarta-POI is looking for:
String CORE_DOCUMENT =
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
Is there a way to make Jakarta-POI read this files?
OOXML Strict Converter for Office 2010 may help if you need to resave the docs using an older format.
Some of the purl namespaces are listed on http://pyxb.sourceforge.net/PyXB-1.2.2/bundles.html (Jethro's link above appears to no longer work).
The up to date XML schema files can be found at:
http://www.ecma-international.org/publications/standards/Ecma-376.htm
We currently have an old Installshield project file (ism) handed to us by our client, created in an unknown older version of Installshield Pro. It needs updating for a new release, but all we have available is Installshield Express 2011. (The install definitely does not actually use any feature unavailable in Express; it barely needs any features at all.)
We need, however, to retrieve a list of what it does do so we can duplicate it.
Is there any way to import, convert or examine the file? (Currently Express refuses to open it at all, because it was created in full Installshield.)
If you do not use specific Professional features you may open xml files with InstallShield LE after following modifications inside
InstallShield table node:
Insert <row><td>DefaultProductConfiguration</td><td>Express</td></row> after Current Media.
Insert <row><td>Limited</td><td>1</td></row> after ISUSSignature
Change "Type" from MSI to MSIE. i.e.:
<row><td>Type</td><td>MSIE</td></row>
This is excerpt from my config file which did the trick:
<table name="InstallShield">
<col key="yes" def="s72">Property</col>
<col def="S0">Value</col>
<row><td>ActiveLanguage</td><td>1033</td></row>
<row><td>Comments</td><td/></row>
<row><td>CurrentMedia</td><td dt:dt="bin.base64" md5="332cf0a04e9833f150480c96800db728">
UgBlAGwAZQBhAHMAZQAgADEAAQBXAGUAYgAgAEMAbwBuAGYAaQBnAHUAcgBhAHQAaQBvAG4A
</td></row>
<row><td>DefaultProductConfiguration</td><td>Express</td></row>
<row><td>EnableSwidtag</td><td>1</td></row>
<row><td>ISCompilerOption_CompileBeforeBuild</td><td>1</td></row>
<row><td>ISCompilerOption_Debug</td><td>0</td></row>
<row><td>ISCompilerOption_IncludePath</td><td/></row>
<row><td>ISCompilerOption_LibraryPath</td><td/></row>
<row><td>ISCompilerOption_MaxErrors</td><td>50</td></row>
<row><td>ISCompilerOption_MaxWarnings</td><td>50</td></row>
<row><td>ISCompilerOption_OutputPath</td><td><ISProjectDataFolder>\Script Files</td></row>
<row><td>ISCompilerOption_PreProcessor</td><td>_ISSCRIPT_NEW_STYLE_DLG_DEFS</td></row>
<row><td>ISCompilerOption_WarningLevel</td><td>3</td></row>
<row><td>ISCompilerOption_WarningsAsErrors</td><td>1</td></row>
<row><td>ISTheme</td><td>InstallShield Blue.theme</td></row>
<row><td>ISUSLock</td><td>{979EF698-F570-46B1-A89A-8FB2EBA0D64F}</td></row>
<row><td>ISUSSignature</td><td>{070AD25F-E904-4DB5-92BF-40E127BD43E7}</td></row>
<row><td>Limited</td><td>1</td></row>
<row><td>LockPermissionMode</td><td>1</td></row>
<row><td>MsiExecCmdLineOptions</td><td/></row>
<row><td>MsiLogFile</td><td/></row>
<row><td>OnUpgrade</td><td>1</td></row>
<row><td>Owner</td><td/></row>
<row><td>PatchFamily</td><td>MyPatchFamily1</td></row>
<row><td>PatchSequence</td><td>1.0.0</td></row>
<row><td>SaveAsSchema</td><td/></row>
<row><td>SccEnabled</td><td>0</td></row>
<row><td>SccPath</td><td/></row>
<row><td>SchemaVersion</td><td>773</td></row>
<row><td>Type</td><td>MSIE</td></row>
</table>
Express will not open such a file. However depending on whether the file's contents are text or binary, you can either open it with any XML or text editor, or with any MSI reading tool. For the latter there's Microsoft's Orca or various alternatives that are easier to download.