简体   繁体   English

在java中将xls转换为xlsx

[英]Converting xls to xlsx in java

I am converting xls files to xlsx using the software from the following link http://www.microsoft.com/en-in/download/details.aspx?id=3我正在使用以下链接中的软件将 xls 文件转换为 xlsx http://www.microsoft.com/en-in/download/details.aspx?id=3

I run the above software by creating a batch file using java.我通过使用java创建批处理文件来运行上述软件。

try {
    String cmds[] = {batPath};
    Runtime runtime = Runtime.getRuntime();
    Process process = runtime.exec(cmds);
    process.getOutputStream().close();
    InputStream inputStream = process.getInputStream();
    InputStreamReader inputstreamreader = new InputStreamReader(inputStream);
    BufferedReader bufferedrReader = new BufferedReader(inputstreamreader);
    String strLine = "";
    while ((strLine = bufferedrReader.readLine()) != null) {
        //    System.out.println(strLine);
    }
} catch (IOException ioException) {
    ioException.printStackTrace();
}

Every time the converter runs, a dialog box pops up on top saying converting files... The problem is that I may have to run the software 100 times, but it keeps interfering with any other work although my program runs in background.每次转换器运行时,顶部都会弹出一个对话框,说正在转换文件...问题是我可能需要运行该软件 100 次,但它一直干扰任何其他工作,尽管我的程序在后台运行。

Is there another way to do this ?有没有另一种方法可以做到这一点?

See the article [Upgrading to POI 3.5, including converting existing HSSF Usermodel code to SS Usermodel (for XSSF and HSSF)] http://poi.apache.org/spreadsheet/converting.html .请参阅文章 [升级到 POI 3.5,包括将现有的 HSSF 用户模型代码转换为 SS 用户模型(用于 XSSF 和 HSSF)] http://poi.apache.org/spreadsheet/converting.html

There is an example here : Best language to parse extremely large Excel 2007 files这里有一个例子: Best language to parse extra large Excel 2007 files

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM