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

Hi robotics, Thanks a lot. but kindly can u guide, actually i got confused at where you are appending a new row at the end in the code mentioned by you.

Replies are listed 'Best First'.
Re^9: Append new line in excel sheets
by roboticus (Chancellor) on Jul 23, 2014 at 17:09 UTC

    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.

      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 :).

Re^9: Append new line in excel sheets
by perl_new_b (Novice) on Jul 23, 2014 at 13:14 UTC

    Hi @roboticus, I want to append a new line at the end of a excel file(.xls to be precise).

    Kindly guide me for the above. Thanks