Escape commas

瀏覽次數:139 次
跳到第一則未讀訊息

Thomas McCoy

未讀,
2015年3月3日 上午11:02:432015/3/3
收件者: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

未讀,
2015年3月15日 中午12:02:082015/3/15
收件者: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

未讀,
2015年3月15日 中午12:02:082015/3/15
收件者: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:
回覆所有人
回覆作者
轉寄
0 則新訊息