The meaning of life is to explore the world

Fixed the bug in Excel writing

Posted on By Jason Liu

What have been done:

  1. Fixed the bug in Excel writing.
  2. Created the page to handle the request “import-new-specials” from Excel spreadsheet to MongoDB.

Problems encountered:

  1. Opening output stream of Excel file without closing it input stream will empty the file content.

Solution:

  1. The correct sequence of updating Excel file is:
    • Open the input stream and read the rows
    • Close input stream
    • Update the rows
    • Open the output stream
    • Write the rows to the file via output stream