in reply to Re^3: Need to create CSV using Text::CSV
in thread Need to create CSV using Text::CSV

Sorry for the misleading. But I don't want an empty line between the records. I just don't know yet how to post some lines with out empty lines between. I just use the paragraph tag that insert an empty line between written lines. Besides the programs works without empty lines that is what I was looking for.

Update: I learned already. This is the desired output:

a,b
c,d
e,f
etc...

Update2: I think now I undestand what you mean. In a text file the line feed is invisible(at least I don't see blank line between the data using notepad), but when I pasted the data to Excel I saw the blank lines. So, I changed the code to: $csv->eol("\n"); and no blank spaces are seen.

Thanks!

Replies are listed 'Best First'.
Re^5: Need to create CSV using Text::CSV
by Tux (Canon) on Jun 18, 2012 at 06:41 UTC

    It isn't wrong per sé, but why not put the eol attribute in the constructor?

    my $csv = Text::CSV ({ binary => 1, eol => "\n", auto_diag => 1 });

    To convert CSV to XLS, Text::CSV_XS comes with the csv2xls script in the examples folder, so if XLS is your target format, you could use that.


    Enjoy, Have FUN! H.Merijn

      I did that but didn't worked.