还用office呀,改用open office吧,它是完全基于XML的,读写都很方便!!!
解决方案 »
- 给大四计算机考研失败的毕业生指条明路吧!
- java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
- 软件包sun.jdbc不存在是怎么回事啊?
- 登陆界面的跳转
- 关于Font和String的问题。
- ResultSet怎么得到SQL查询聚合函数的值[可能表达得不清楚]
- 像MSN有人登陆时弹出的一个小框用JAVA怎么实现的?
- 如何把字符串转换为的日期
- 苦恼,不知有什么好法子调试程序的.....
- java -jar -classpath c:\a.jar b.jar有错吗?困惑中......
- #########关于外观风格,知道的朋友进来一下,有分!#########
- 两个简单的问题
office好垃圾
POI:Java API To Access Microsoft Format Files
我已经想到方法了,而且实现了,不过只是一个文件一个文件的读取,不能够一次读出多个文件,有谁知道方法吗?
你所说的实现俺还想多问一句?就是把后缀为".doc"的word文件读到内存中吗?
能给俺们介绍一下你如何实现的吗?大致思路就可以了。
如果找不到,俺把URL贴在下面:
<<
http://nagoya.apache.org/mirror/jakarta/poi/release/
>>:)
你给的这个包我以前用过,但是我只能实现对Excel表进行提取,Word文档的提取我还没试过,不知道用什么方法>?我用Google搜索了一下,用java来提取.doc的方法根本就是太少了。我现在只能先把.doc文档转换成XML才可能实现了。
呵呵,很久没有跟踪POI了,俺看了一下1.5.1final release,现在确实只实现了HSSF (Horrible Spreadsheet Format)的支持,能够解析Excel97-xp的文档。而解析word97-xp的HDF (Horrible Document Format)的支持,俺看文档说应该在2.0release的时候提供lib。
所以你现在可以暂时不考虑POI了,呵呵。
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<?xml:stylesheet type="text/xsl" href="sdocbook.xsl"?>
<!-- generated by Majix from F:\3.doc on Thu Dec 04 16:19:29 CST 2003 using template SDocBook -->
<!DOCTYPE article PUBLIC "-//Normaln Walsh//DTD Simplified DocBk XML V3.1.4.1//EN" "..\..\sdocbook\sdocbook.dtd" [
]>
<article>
<table>
<row><cell><para></para><para></para><para><emphasis>Ö</emphasis><emphasis>Ð</emphasis><emphasis>¹</emphasis><emphasis>ú</emphasis><emphasis>´</emphasis><emphasis>ó</emphasis><emphasis>Ì</emphasis><emphasis>Æ</emphasis><emphasis>¼</emphasis><emphasis>¯</emphasis><emphasis>Í</emphasis><emphasis>Å</emphasis><emphasis>¹</emphasis><emphasis>«</emphasis><emphasis>Ë</emphasis><emphasis>¾</emphasis></para><para><emphasis>¹</emphasis><emphasis>¤</emphasis><emphasis>³</emphasis><emphasis>Ì</emphasis><emphasis>¹</emphasis><emphasis>Ü</emphasis><emphasis>À</emphasis><emphasis>í</emphasis><emphasis>×</emphasis><emphasis>¨</emphasis><emphasis>Ò</emphasis><emphasis>µ</emphasis><emphasis>È</emphasis><emphasis>Ë</emphasis><emphasis>²</emphasis><emphasis>Å</emphasis><emphasis>¿</emphasis><emphasis>â</emphasis><emphasis>É</emphasis><emphasis>ê</emphasis><emphasis>±</emphasis><emphasis>¨</emphasis><emphasis>±</emphasis><emphasis>í</emphasis></para>
</cell></row><row><cell><para><c color='black'>name</c></para>
</cell>
<cell><para><c color='black'>Horry</c></para>
</cell>
<cell><para><c color='black'>sex</c></para>
</cell>
<cell><para><c color='black'>male</c></para>
</cell>
<cell><para><c color='black'>Year</c></para>
</cell>
<cell><para><c color='black'>74.07</c></para>
</cell></row><row><cell><para><c color='black'>College</c></para>
</cell>
<cell><para><c color='black'>C</c><c color='black'>hasha.college</c></para>
</cell>
<cell><para><c color='black'>Time</c></para>
</cell>
<cell><para><c color='black'>95.07</c></para>
</cell>
<cell><para><c color='black'>level</c></para>
</cell>
<cell><para><c color='black'>junior college</c></para>
</cell></row><row><cell><para><c color='black'>Number</c></para>
</cell>
<cell><para><c color='black'>430419750225053</c></para>
</cell>
<cell><para><c color='black'>degree</c></para>
</cell>
<cell><para><c color='black'>Null</c></para>
</cell></row><row><cell><para><c color='black'>specialty</c></para>
</cell>
<cell><para><c color='black'>computer</c></para>
</cell>
<cell><para><c color='black'>specialty</c></para>
</cell>
<cell><para><c color='black'>computer</c></para>
</cell></row><row><cell><para><c color='black'>W</c><c color='black'>ork </c><c color='black'>type</c></para>
</cell>
<cell><para><c color='black'>empolder</c></para>
</cell>
<cell><para><c color='black'>W</c><c color='black'>ork </c><c color='black'>type</c></para>
</cell>
<cell><para><c color='black'>empolder</c></para>
</cell></row><row><cell><para><c color='black'>W</c><c color='black'>ork </c><c color='black'>unit</c></para>
</cell>
<cell><para><c color='black'>Lei</c> <c color='black'>eletricity</c></para>
</cell>
<cell><para><c color='black'>dut</c><c color='black'>y</c></para>
</cell>
<cell><para><c color='black'>NULL</c></para>
</cell></row><row><cell><para><c color='black'>duty</c></para>
</cell>
<cell><para><c color='black'>technician</c></para>
</cell>
<cell><para><c color='black'>phone</c></para>
</cell>
<cell><para><c color='black'>2363</c></para>
</cell>
<cell><para><c color='black'>faxes</c></para>
</cell>
<cell><para><c color='black'>Null</c></para>
</cell></row><row><cell><para><c color='black'>Family</c><c color='black'> phone</c></para>
</cell>
<cell><para><c color='black'>4189</c></para>
</cell>
<cell><para><c color='black'>E_mail</c></para>
</cell>
<cell><para><c color='black'>[email protected]</c></para>
</cell>
<cell><para><c color='black'>combined set</c></para>
</cell>
<cell><para><c color='black'>000</c></para>
</cell></row><row><cell><para><c color='black'>Address</c></para>
</cell>
<cell><para><c color='black'>Lei</c> <c color='black'>eletricity</c></para>
</cell>
<cell><para><c color='black'>Mail</c></para>
</cell>
<cell><para><c color='black'>421800</c></para>
</cell></row><row><cell><para><c color='black'>¹</c><c color='black'>¤</c><c color='black'>×</c><c color='black'>÷</c><c color='black'>¼</c><c color='black'>ò</c><c color='black'>À</c><c color='black'>ú</c></para>
</cell>
<cell><para><c color='black'>1995-2003 </c><c color='black'>Lei</c> <c color='black'>eletricity</c></para>
</cell></row><row><cell><para><c color='black'>success</c></para>
</cell>
<cell><para></para><para><c color='black'>Null</c></para>
</cell></row><row><cell><para><c color='black'>commend</c> <c color='black'>idea</c></para>
</cell>
<cell><para><c color='black'>Null</c></para>
</cell></row>
</table>
<para></para>
</article>
比如结果是table和para的聚集。table是row的聚集,row是cell的聚集,cell是para的聚集,para是emphasis和c的聚集,etc。
针对这个数据结构再构建相应的方法。可以尝试一下。