我正在使用以下 api 从 Excel 中读取数据作为表:https://jtablesaw.github.io/tablesaw/gettingstarted
代码如下:
XlsxReader reader = new XlsxReader();
XlsxReadOptions options = XlsxReadOptions.builder("excel/file_example_XLSX_10.xlsx").build();
try {
tab = reader.read(options);
// System.out.println(tab.print());
} catch (Exception e) {
e.printStackTrace();
}
文件 file_example_XLSX_10.xlsx 大小约为 120 mb,我收到 OutOfMemoryError。
有没有办法让我只读取文件中的特定列。
最佳答案
我认为没有办法只读取某些列,您是否尝试过使用 Apache POI 来读取 Excel?或者运行时增加内存?
关于java - 使用 Tablesaw 读取 excel 会导致 OutOfMemoryError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62447105/