Reputation: 1
I am having a excel sheet which will have file information like file name , size , last modified date in separate columns . I need to extract file name alone form first column and got to that path and copy that file to other directory using java. Please help me in this
Upvotes: 0
Views: 966
Reputation: 11
You can try to use this jar library:
https://afajardomorera.github.io/ExcelReader/
You can define a Java Object with the fields you need, configure a property file and invoke the reader method from the jar.
In the github code, you find a jar_generated folder with the latest version of the jar to use it.
Upvotes: 1
Reputation: 726
I can think of two solutions:
InputStream fis= new FileInputStream("workbook.xlsx"); Workbook wb = WorkbookFactory.create(fis); Sheet sheet = wb.getSheetAt(0); Row row = sheet.getRow(2); Cell cell = row.getCell(3);
To copy the file, you can use Apache commons' fileUtils.copy
Upvotes: 1