Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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.


Comment on Re^4: Need to create CSV using Text::CSV
Download Code
Replies are listed 'Best First'.
Re^5: Need to create CSV using Text::CSV
by Tux (Monsignor) 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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2015-12-01 20:32 GMT
Find Nodes?
    Voting Booth?

    My keyboard shows this many letters:

    Results (26 votes), past polls