I know i am missing the main function here. I want to copy/ write only particular row from my source excel to destination excel using apache POI.
eg. My source excel has 10 rows. I need only 5th row to be copied to my destination excel.
My class,
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();
}
}