【发布时间】:2020-02-17 18:17:23
【问题描述】:
我知道我在这里缺少主要功能。我想使用 apache POI 仅将源 excel 中的特定行复制/写入目标 excel。
例如。我的源 excel 有 10 行。我只需要将第 5 行复制到我的目标 excel。
我的班级,
public class Test1 {
public static void main(String[] args) throws Exception{
File srcFile=new File("C:\\Test\\Read.xlsx");
FileInputStream fis=new FileInputStream(srcFile);
XSSFWorkbook wb=new XSSFWorkbook(fis);
XSSFSheet sheet1=wb.getSheetAt(0);
File desFile=new File("C:\\Test\\Write.xlsx");
FileOutputStream fout=new FileOutputStream(desFile);
wb.write(fout);
wb.close();
}
}
【问题讨论】:
-
为什么在此处标记 Selenium?我错过了什么吗?
标签: java excel apache-poi