还用office呀,改用open office吧,它是完全基于XML的,读写都很方便!!!

解决方案 »

  1.   

    NODNOD,open office ,
    office好垃圾
      

  2.   

    http://jakarta.apache.org/poi/index.html
    POI:Java API To Access Microsoft Format Files
      

  3.   

    我晕难道就没人知道吗?我知道用open office能够解决,但现在的问题是我在用微软的Office啊
      

  4.   

    俺晕,gdsean(摇滚java) 不是说了嘛。
      

  5.   

    天啦,想不到CSDN里连个高手都没有。这个小问题都没有人回答得出来吗?:(好郁闷。
    我已经想到方法了,而且实现了,不过只是一个文件一个文件的读取,不能够一次读出多个文件,有谁知道方法吗?
      

  6.   

    TO xiaohaozi2101(一剑无血): 呵呵,俺们本来就是靠“混”的。
    你所说的实现俺还想多问一句?就是把后缀为".doc"的word文件读到内存中吗?
    能给俺们介绍一下你如何实现的吗?大致思路就可以了。
      

  7.   

    对了,另外说一下,POI项目正在研究是不错,而且一直都在研究。但是现在已经有发布版可以下载了。而且现在已经发布到了 1.5.1 了。
    如果找不到,俺把URL贴在下面:
    <<
    http://nagoya.apache.org/mirror/jakarta/poi/release/
    >>:)
      

  8.   

    OK 我的思路是:我能够选择多个.doc文件,然后在后台进行处理,把这些.doc的资料进行解析出来,存到数据库里面去。  你给的这个POI我已经下载了,谢谢不过下是下了,就是不知道怎么用?你能帮助我吗?这个东东具体是怎么实现的? 我现在用的是一个就做Majix的一个东东,里面可以把.doc文档转换成为XML标记语言,然后再根据java去提取,我现在的问题就是Majix只能一个文件一个文件的解析,我不知道如何一次性解析多个文档.
      

  9.   

    TO: xiaohaiz(老土进城,两眼通红) 
            你给的这个包我以前用过,但是我只能实现对Excel表进行提取,Word文档的提取我还没试过,不知道用什么方法>?我用Google搜索了一下,用java来提取.doc的方法根本就是太少了。我现在只能先把.doc文档转换成XML才可能实现了。
      

  10.   

    TO xiaohaozi2101(一剑无血) :
    呵呵,很久没有跟踪POI了,俺看了一下1.5.1final release,现在确实只实现了HSSF (Horrible Spreadsheet Format)的支持,能够解析Excel97-xp的文档。而解析word97-xp的HDF (Horrible Document Format)的支持,俺看文档说应该在2.0release的时候提供lib。
    所以你现在可以暂时不考虑POI了,呵呵。
      

  11.   

    这是我用Majix解析出来的XML,但是我用java解析下面这个XML的时候,竟然提示错误,解析不出来! 解析XML的方法有好几种,你一般用哪种方法实现比较容易呢?帮我看看这个XML该怎么解出来好吗?可以帮我解析一下这个文件吗?万分感谢了。。呵呵。。麻烦你了:)
    <?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>&#xd6;</emphasis><emphasis>&#xd0;</emphasis><emphasis>&#xb9;</emphasis><emphasis>&#xfa;</emphasis><emphasis>&#xb4;</emphasis><emphasis>&#xf3;</emphasis><emphasis>&#xcc;</emphasis><emphasis>&#xc6;</emphasis><emphasis>&#xbc;</emphasis><emphasis>&#xaf;</emphasis><emphasis>&#xcd;</emphasis><emphasis>&#xc5;</emphasis><emphasis>&#xb9;</emphasis><emphasis>&#xab;</emphasis><emphasis>&#xcb;</emphasis><emphasis>&#xbe;</emphasis></para><para><emphasis>&#xb9;</emphasis><emphasis>&#xa4;</emphasis><emphasis>&#xb3;</emphasis><emphasis>&#xcc;</emphasis><emphasis>&#xb9;</emphasis><emphasis>&#xdc;</emphasis><emphasis>&#xc0;</emphasis><emphasis>&#xed;</emphasis><emphasis>&#xd7;</emphasis><emphasis>&#xa8;</emphasis><emphasis>&#xd2;</emphasis><emphasis>&#xb5;</emphasis><emphasis>&#xc8;</emphasis><emphasis>&#xcb;</emphasis><emphasis>&#xb2;</emphasis><emphasis>&#xc5;</emphasis><emphasis>&#xbf;</emphasis><emphasis>&#xe2;</emphasis><emphasis>&#xc9;</emphasis><emphasis>&#xea;</emphasis><emphasis>&#xb1;</emphasis><emphasis>&#xa8;</emphasis><emphasis>&#xb1;</emphasis><emphasis>&#xed;</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'>&#xb9;</c><c color='black'>&#xa4;</c><c color='black'>&#xd7;</c><c color='black'>&#xf7;</c><c color='black'>&#xbc;</c><c color='black'>&#xf2;</c><c color='black'>&#xc0;</c><c color='black'>&#xfa;</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>
      

  12.   

    根据xml抽象出你自己的数据结构。
    比如结果是table和para的聚集。table是row的聚集,row是cell的聚集,cell是para的聚集,para是emphasis和c的聚集,etc。
    针对这个数据结构再构建相应的方法。可以尝试一下。