Test to Read Excel File as XML with jxl.jar

Q

How to run the test to read an existing Excel file as XML output with jxl.jar?

✍: FYIcenter.com

A

The following steps shows you how to run the test to read an existing Excel file as XML output with jxl.jar:

1. Open command line window to verify jxl.jar installation. "jxl.jar" file and "jxlrwtest" file are needed:

C:\cd \fyicenter\jexcelapi

C:\fyicenter\jexcelapi>dir
10/24/2009  10:11 AM           725,735 jxl.jar
09/07/2009  03:26 PM            93,696 jxlrwtest.xls
...

2. Use the "java -jar" command to run the test program:

C:\fyicenter\jexcelapi>\local\jdk-1.8.0\bin\java 
   -jar jxl.jar -xml jxlrwtest.xls | more

<?xml version="1.0" ?>
<!DOCTYPE workbook SYSTEM "workbook.dtd">

<workbook>
  <sheet>
    <name><![CDATA[original]]></name>
    <row number="0">
      <col number="0"><![CDATA[Java Excel API Modify Test]]></col>
    </row>
    <row number="1">
      <col number="4"><![CDATA[Bold]]></col>
      <col number="5"><![CDATA[4dps]]></col>
    </row>
    <row number="2">
      <col number="0"><![CDATA[Labels]]></col>
      <col number="3"><![CDATA[MulRK records - no modification]]></col>
      <col number="4"><![CDATA[1]]></col>
      <col number="5"><![CDATA[2.0000]]></col>
      <col number="6"><![CDATA[3]]></col>
      <col number="7"><![CDATA[4]]></col>
      <col number="8"><![CDATA[5]]></col>
      <col number="9"><![CDATA[6]]></col>
      <col number="10"><![CDATA[7]]></col>
    </row>
-- More  --

 

Demo Programs for jxl.jar

⇒⇒FAQ for Java Excel API jxl.jar

2018-04-07, 358👍, 0💬