title: Reading and writing excel sheet using java apache POI
body: <p>I am reading excel sheet using java apache POI. After reading i want to write on the same row, The ode is reading perfectly but not writing I want to create 6th column in every row in each iteration....   here is the code</p>
  
  <pre><code> /**
   * Created by Muhammad Hussain on 26/10/2016.
   */
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileOutputStream;
  import java.io.IOException;
  import java.util.Iterator;
  
  import org.apache.poi.ss.usermodel.Cell;
  import org.apache.poi.ss.usermodel.Row;
  import org.apache.poi.ss.usermodel.Sheet;
  import org.apache.poi.ss.usermodel.Workbook;
  import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  import java.util.Scanner;
  
  /**
   * A dirty simple program that reads an Excel file.
   * @author www.codejava.net
   *
   */
  public class ReadExcel {
  
      public static void main(String[] args) throws IOException {
          String excelFilePath = "C:\\Users\\Muhammad Hussain\\Desktop\\Data-Collection.xlsx";
          FileInputStream inputStream = new FileInputStream(new File(excelFilePath));
  
          Workbook workbook = new XSSFWorkbook(inputStream);
          Sheet firstSheet = workbook.getSheetAt(4);
          Scanner input =new Scanner(System.in);
          for (int rowIndex = 1; rowIndex &lt;= 5; rowIndex++) {
  
              Row row = firstSheet.getRow(rowIndex);
              Cell cell = row.getCell(3);
              String review = cell.getStringCellValue();
              System.out.println(review);
              String label =input.next();
              row.createCell(6).setCellValue(label);
  
          }
  
          inputStream.close();
          inputStream.close();
      }
  
  }
  </code></pre>