parseCsv : Could not parse text ?

3,120 views
Skip to first unread message

Guillaume

unread,
Oct 17, 2014, 3:59:03 AM10/17/14
to adwords...@googlegroups.com
Dears,

First, sorry for my bad engllish, I'm french!
I try to parse a csv file with an AdWords Script :

var url = "http://www.example.com/googlemerchant.txtx";
var csvString = UrlFetchApp.fetch(url).getContentText();
var csvdata = Utilities.parseCsv(csvString);

But on "parseCsv" line, I got follow error : "Could not parse text. (line 18)".
 
My csv file seems ok:
id title description price condition link image_link sale_price sale_price_effective_date availability brand gtin shipping_weight google_product_category product_type

All datas are separated by tab (without \t).

Do you have any idea ?

Thanks,
Guillaume.

Anash Oommen

unread,
Oct 17, 2014, 9:18:32 AM10/17/14
to adwords...@googlegroups.com
Hi Guillaume,

You can use the overloaded version of parseCsv that takes the delimiter as the second parameter. See https://developers.google.com/apps-script/reference/utilities/utilities#parseCsv(String,Char).

Cheers,
Anash P. Oommen,
AdWords Scripts Team.
Reply all
Reply to author
Forward
0 new messages