Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: how to print commas in csv

by Corion (Patriarch)
on Jan 04, 2010 at 09:33 UTC ( [id://815547]=note: print w/replies, xml ) Need Help??


in reply to how to print commas in csv

How to retain commas in CSV is a question of how your receiving program parses the CSV. I'd use Text::CSV to write the CSV, then it will write the files mostly like Excel would, using double quotes to denote strings.

Replies are listed 'Best First'.
Re^2: how to print commas in csv
by tweetiepooh (Hermit) on Jan 04, 2010 at 12:06 UTC
    Yup, I agree here.

    Another possibility is if the receiving program can define its separator to use a different character to comma not found in the data. (I like TAB).

      I love TAB so much that i have this in my .vimrc:
      """""""" "" Rotate tabstop value between 2, 4, 8, 16, 32 and 64 "" Mapped to <F2> "" function FDO_TabToggle () let TabStopVal = &tabstop let TabStopVal = TabStopVal * 2 if TabStopVal > 64 let TabStopVal = 2 endif let &tabstop = TabStopVal echo"TabStop is now: " TabStopVal endfunction
      A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-25 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found