Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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:

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!


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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://976672]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (14)
As of 2015-07-31 19:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (280 votes), past polls