[英]How to write existing excel (*.xlsx) file on different column using POI in Java?
Dear all member here!! 亲爱的所有会员!
I got a problem that need to ask your help. 我有一个问题需要向您寻求帮助。 I already have an excel file (sample.xlsx).
我已经有一个excel文件(sample.xlsx)。 I need to use java code for appending my old data.
我需要使用Java代码附加我的旧数据。
Here is my specifications: 这是我的规格:
Is it possible to do that in POI? 是否可以在POI中做到这一点?
Here is what you need to do. 这是您需要做的。
XSSFSheet sheet = workbook.getSheet("sample");
for(int i=0; i<numberOfRowsToWriteDataIn; i++) {
XSSFRow row = sheet.getRow(i);
row.createCell(5).setCellValue("Creation Date: "+ new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
}
Hope that helps. 希望能有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.