This blog is for Automation Test Engineers

Friday 16 March 2018

Writing data into excel sheet


FileInputStream fis=new FileInputStream("E:\\data.xlsx");              Workbook wb=WorkbookFactory.create(fis);
Sheet s=wb.getSheet("test");//sheet name
s.createRow(1).createCell(1).setCellValue("Java");
FileOutputStream fos = new  FileOutputStream("E:\\data.xlsx");
 wb.write(fos);
 fos.close();
System.out.println("Success");



                 }


2

2 comments: