title: writing a new cell to a sheet apache poi
body: <p>i am using following code, for reading a excel using apache poi, its a .xlsx file. Please let me know what i can do, to also alter a value of a cell, in each row as my loop keeps going. Thanks</p>
  
  <pre><code>import java.io.FileInputStream;
  import org.apache.poi.ss.usermodel.Cell;
  import org.apache.poi.xssf.usermodel.XSSFRow;
  import org.apache.poi.xssf.usermodel.XSSFSheet;
  import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  
  String fileName = "C:/createCDN.xlsx";
  FileInputStream fis = null;
  fis = new FileInputStream(fileName);
  XSSFWorkbook workbook = new XSSFWorkbook(fis);
  FileOutputStream fos=new FileOutputStream(fileName);
  XSSFSheet sheet = workbook.getSheetAt(0);
  int totalRows=sheet.getLastRowNum();
  for(int i=1;i&lt;=totalRows;i++) {
      XSSFRow row = sheet.getRow(i);
      method.fillTextBox(row.getCell(0),"name", pageProp);
      method.fillTextBox(row.getCell(0),"name", pageProp);
  } //Do something here, or inside loop to write to lets say cell(2) of same row.
  </code></pre>
  
  <p>Thanks.</p>