in reply to Re^8: Append new line in excel sheets
in thread Append new line in excel sheets

perl_new_b:

The bit of code I showed doesn't append a new row. Instead, it creates an array with the data in the original Excel spreadsheet. All you need to do is to append the data to the appropriate places in the array, and then write the data. Excel can read a .CSV file, so I'd just use Text::CSV to write the data file. (You can even name it with a .xls extension and Excel will read it nicely. Remember, though, there will be no formatting or charts.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^10: Append new line in excel sheets
by perl_new_b (Novice) on Jul 24, 2014 at 05:22 UTC

    Hi @Roboticus,

    I want to append the data to a excel file having .xls extension, can TEXT::CSV do that?

    And you are right I don't need any formatting in that.

      perl_new_b:

      You can create a new file .csv file (named with a .xls extension) and put all the data in it. Text::CSV will do that. But it won't append data to an existing .xls file.

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.

      Hi @roboticus,

      I want to clear my point in case I missed to mention. I'm reading a .xls file and convertion into .csv using ParseExcel cell handler. But cell handler is missing the last row of excel file. So first I need to append a new row at end then will convert it into CSV.

      Thought I can try what you have suggested me :).

        perl_new_b:

        The cell handler shouldn't be missing any data. Can you show an example?

        ...roboticus

        When your only tool is a hammer, all problems look like your thumb.