Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: How do I create a CSV from a 2D array?

by fenonn (Chaplain)
on Jun 08, 2001 at 01:43 UTC ( [id://86770]=note: print w/replies, xml ) Need Help??


in reply to How do I create a CSV from a 2D array?

As long as @data is a 2D array this statement will store the data in CSV form in the scalar $temp so that it can be printed out to a file.
$temp = join "\n", map { $_ = join ",", @{$_} } @data;

Replies are listed 'Best First'.
Re: Answer: How do I create a CSV from a 2D array?
by hossman (Prior) on May 29, 2003 at 23:52 UTC
    This doesn't account for field values which may contain double-quotes, single-quotes, commas, or embedded newlines.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-25 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found