Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^4: Need to create CSV using Text::CSV

by oldwarrior32 (Sexton)
on Jun 17, 2012 at 17:14 UTC ( #976672=note: print w/replies, xml ) Need Help??

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:


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.


Replies are listed 'Best First'.
Re^5: Need to create CSV using Text::CSV
by Tux (Abbot) 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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://976672]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2018-05-22 03:07 GMT
Find Nodes?
    Voting Booth?