Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: CSV to Excel

by Tux (Abbot)
on Jun 09, 2010 at 06:19 UTC ( #843814=note: print w/replies, xml ) Need Help??

in reply to CSV to Excel

Text::CSV_XS comes with csv2xls in the examples folder. I use that in production code for customers on an almost daily basis.

Others suggest to open CSV with Excel directly. This might work, but more likely is very error-prone. Excel converts many "things" is the imported data based on various outside settings, like locale and local list-separator characters. That means that your numbers might turn into dates, and your (ISO)dates YYYYMMDD suddenly become dates in braindead US format (MM/DD/YY), even if the CSV data was quoted!

For that last problem, csv2xls has the -D option, in which you can specify what columns represent dates and a -d option to specify the required date format.

Enjoy, Have FUN! H.Merijn

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2021-01-26 22:51 GMT
Find Nodes?
    Voting Booth?