Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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
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 examining the Monastery: (6)
As of 2014-07-31 00:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (241 votes), past polls