views:

170

answers:

2

I have an Excel sheet and am able to convert it into .csv format using Perl. My only problem is that some of my data in the Excel sheet cells contain commas and that has to be retained in the CSV format also, but while converting it takes as a seperator. How can I retreive the data in the cell with commas as it is and print it in the CSV?

For example, in the Excel sheet A1 cell contains the data {0xAAAA,0xFFFF,0xAAAA,0xAAAA} I want the same data with commas in the A1 cell in CSV file also. I am Spreadsheet::ParseExcel.

A: 

To avoid the commas in your fields to be interpreted as separators, enclose your fields with characters like double quotes:

"10","10,00","156"

kemp
If you enclose your fields with "", you also have to escape the double quotes in the value.
brian d foy
+8  A: 

Use Text::CSV for parsing and creating your csv files. Be more specific if you do not know how to use the module for your task.

weismat