You are here:  » Poorly formed Field in feed...


Poorly formed Field in feed...

Submitted by jezza101 on Mon, 2009-11-30 14:13 in

Hi, just thought I'd post on the off chance anyone had some ideas or a quick solution. I am successfully parsing the Affiliate Window Voucher code feed (csv|44|1|34), until I hit a certain row:

"Lasertech UK Ltd","2469","******","FREE 5" Spidie the Spider Lil' Peeper by Russ when you order over £75 of Lasertech Brand products (excluding VAT)","{link saved}","2009-12-31 23:59:59"

I think the problem is the 5" which obviously breaks the quoted text identification - set to use the double quote.

Is that something that would break the parsing (the next dozen rows or so then seem to be lumped together into one field)? And if so, is there a quick fix other than reporting the issue and hoping AWIN fix it?

Many thanks.

Submitted by support on Mon, 2009-11-30 14:19

Hello Jezza,

Unfortunately there's isn't any easy fix i'm afraid; unless it can be guaranteed that there are no commas encountered anywhere other than as the field separator; in which can you could parse without the quoted text flag (using Format String csv|44|1|0), and then at the top of your myRecordHandler function; trim the " character from every field using:

  foreach($record as $k => $v) $record[$k] = trim($v,"\"");

Hope this helps!
Cheers,
David.

Submitted by jezza101 on Mon, 2009-11-30 16:58

Thanks David!

I suspect there probably will be commas in there although some of the AWIN feeds also come with | delimiters so I'll see if that is available. If so your suggestion seems a good idea!

I will report back the issue to AWIN and see if they can fix! I'd imagine other users must be hitting this problem.

Cheers,
Jez.