v201607 Error quoting values in CSV output file

123 views
Skip to first unread message

rstro...@reddogmediainc.com

unread,
Aug 3, 2016, 1:27:48 AM8/3/16
to AdWords API Forum
According to the upgrade documentation, "On all reports, fields that begin with the special characters - (minus) or + (plus) will be double-quoted without a leading space in the CSV, CSVFOREXCEL, and TSV download formats to avoid treating the values as formula when importing report output into spreadsheets".  This results in the following (for the AdPerformanceReport, in this case. Most of the data has been removed.):

Ad ID,Ad group ID,Ad
17324204435,5864310275,""+ Arthur Ashe Stadium - Corona, NY""

The problem is that the double double quotes (in the third field) are not (as far as I have been able to determine) valid CSV delimiters.  I have tried several different CSV parsing libraries and they all fail to parse this line.  I even tried opening the file in Excel, and it also failed to read that field.
Is this a known problem and is there a workaround?

Thanks!

Robert

Joyce Lava

unread,
Aug 3, 2016, 1:59:50 AM8/3/16
to AdWords API Forum
Hi Robert,

Apologies as I am not totally sure if I understood what you are trying to do. Please let me know if my understanding is incorrect so we can provide appropriate responses. 

Yes, report fields with values that start with minus (-) and plus (+) will be double-quoted. With this, are you trying to use the double quote (") as the delimiter? Based from what I understood in the doc, the field is double-quoted to avoid treating the field value as a formula when importing into spreadsheet and thus, if you will have to programmatically parse the line, you would still have to use the comma (,) as the delimiter. Additionally, with my test account, when I generated a report (e.g. report.csv), the double quote is not included in the cell value.

Could you please provide more details on what you wish to achieve so we can investigate further?

Thanks,
Joyce, AdWords API Team

rstro...@reddogmediainc.com

unread,
Aug 3, 2016, 10:56:21 AM8/3/16
to AdWords API Forum
No, I'm not trying to use the double double quote as a delimiter. I am simply trying to parse the file as a normal comma-delimited file as I have always done. It now fails, because a double double quote is not a valid field delimiter, apparently. As I mentioned before, even Excel fails to open the file, so the whole reason for putting these in in the first place fails. I just need to be able to parse this file as I always have, and with the double double quotes in there, I can't do that.
If you want to reproduce the problem, simply copy the two sample lines and paste them into a text file and then try to parse the file using any CSV parser, or try opening it in Excel.
Can you fix it so that it puts a single double quote instead of a double double one?

Thanks!

Robert

rstro...@reddogmediainc.com

unread,
Aug 3, 2016, 2:58:04 PM8/3/16
to AdWords API Forum
I tried this with v201605 and it works correctly - it returns one double quote at the beginning and one at the end of the field:

Ad ID,Ad group ID,Ad
17324204435,5864310275,"+ Arthur Ashe Stadium - Corona, NY"

So it looks like something changed between v201605 and v201607.

Robert

Joyce Lava

unread,
Aug 4, 2016, 1:31:46 AM8/4/16
to AdWords API Forum
Hi Robert,

Thanks for the information you provided. Apologies for not realizing the scenario earlier. I tried to do the same using my test account and after doing some tests, I noticed that the double double-quoting might be caused by the comma (,). The issue is not happening when the value begins with minus (-) or plus (+) and does not contain comma (,). I can confirm as well that the issue happens with the v201607 only. In that case, while our team is investigating into the issue, I would recommend to use the v201605 for the meantime in getting the report field values that begins with minus (-) and plus (+) and contains comma (,) as a workaround. I hope this can be helpful for now.

Thanks for bringing this up into our attention and I will update this case once we have any updates.

Best Regards,
Joyce, AdWords API Team

Nadine Sundquist (AdWords API Team)

unread,
Aug 11, 2016, 11:13:30 AM8/11/16
to AdWords API Forum
Hello Robert,

Could you please give this a try to see if it is now working for you?

Thanks,
Nadine, AdWords API Team

Brett Rogers

unread,
Aug 26, 2016, 7:06:47 PM8/26/16
to AdWords API Forum
Nadine / Joyce,

Answering on Robert's behalf, yes, it is now working for us and we have now upgraded to API v201607. Thank you for your help.

-Brett
Reply all
Reply to author
Forward
0 new messages