Not sure if i am doing this correctly. I am reading a xlsx file and then
extracting few columns and want to save them in a csv. So below is what
i am doing:
The loop goes through all the rows, and then you write to the CSV so you
are only writing the last row, which may be empty?
In the loop, you are creating a new array containing a single value,for
each row/col
Not clear from the code if you really need the assignment either, seems
redundant.
In any case this is what I think it should be:
I don't have Ruby at work so this is just an educated guess
···
On Mon, Jul 29, 2013 at 2:23 PM, Rochit Sen <lists@ruby-forum.com> wrote:
Hi All,
Not sure if i am doing this correctly. I am reading a xlsx file and then
extracting few columns and want to save them in a csv. So below is what
i am doing:
The loop goes through all the rows, and then you write to the CSV so you
are only writing the last row, which may be empty?
In the loop, you are creating a new array containing a single value,for
each row/col
Not clear from the code if you really need the assignment either, seems
redundant.
In any case this is what I think it should be: