Escape commas

162 views
Skip to first unread message

Thomas McCoy

unread,
Mar 3, 2015, 11:02:43 AM3/3/15
to spreadsheet...@googlegroups.com
Hi,

I'm not a perl scripter. I got a project tossed at me and a requirement is to convert a csv to xls. I found your Spreadsheet::WriteExcel solution. I got it working. I created a script using the documentation that creates a 3 tab Excel file with most of the formatting I need. 

But I'm stuck trying to escape commas that are in my csv file. One of the columns in my csv files will contain commas. I've tried using field quotes. I've tried using pipes instead of commas. Both blew up on me. Can anyone assist me?

Tom

mchappell67

unread,
Mar 15, 2015, 12:02:08 PM3/15/15
to spreadsheet...@googlegroups.com
Additionally, if a field containing a comma is surrounded by double quotes, the embedded comma is NOT considered a separator.
 
Mark

mchappell67

unread,
Mar 15, 2015, 12:02:08 PM3/15/15
to spreadsheet...@googlegroups.com
I'm using Text-CVS_XS to read CSV files to convert to Excel.  I escape commas with a backslash (\).
 
Mark
 
P.S. Your profile says you're in River Grove - I'm right next door in Elmwood Park...
 

On Tuesday, March 3, 2015 at 10:02:43 AM UTC-6, Thomas McCoy wrote:
Reply all
Reply to author
Forward
0 new messages