Results 1 to 6 of 6
  1. #1
    Newbie
    Join Date
    April 5th, 2008
    Posts
    3
    Two tiered csv feed
    Hi
    I'm using Dirks Datafeed script from a couple of years ago to process csv files, but the problem is that the feed has two tiers (tradedoubler). the top tier contains general details to cover all merchants, but there is also a second tier called Fields, which contains data specific to the merchant.

    can someone pleas help me with extracting the second tier data, as it contains a field that I will need to query.



    many thanks

  2. #2
    ABW Ambassador PatrickAllmond's Avatar
    Join Date
    September 20th, 2005
    Location
    OKC
    Posts
    1,219
    Can you please post a sample of the fields and what you want to do with it?
    ---
    This response was masterly crafted via the fingers of Patrick Allmond who believe you should StopDoingNothing starting today.
    ---
    Focus Consulting is where I roll | Follow @patrickallmond on Twitter
    Search Engine Marketing | Search Engine Optimization | Social Media | Online Video

  3. #3
    Newbie
    Join Date
    April 5th, 2008
    Posts
    3
    Sorry, forgot to post a sample, here it is.

    name|productUrl|imageUrl|TDCategoryName|merchantCategoryName|programName|programLogoPath|fields
    |ALBANI ROME|||http://pdt.tradedoubler.com/click?a(1497511)p(14612)prod(10046826)ttid(5)|||http://images.alpha-beds.com/ALBANI_ROME_in_ROME-sm.jpg|||Travel|||Offer|||AlphaRooms|||http://img.tradedoubler.com/images/uk/merchants/alpharooms_100.gif|||Address1|Via Adda 45|Address2|null|City|Rome|State|null|Zip|00198|

    As you can see, in the header there's a fields header, and this contains subset of fields. My question is, how do I treat this subset of data in the same way as the top level data. Ideally I would like to produce table columns for each peice of data within the field header ie. Address1, Address2, City, etc.

    This is really important as I'm advertising on one specific product, and the the city field is what I need to run my query on.


    I'm thinking that the best way forward would be to do a search and replace on |||, and replace with |, which would effectively bring everything up to the same level?

    thanks

  4. #4
    ABW Ambassador PatrickAllmond's Avatar
    Join Date
    September 20th, 2005
    Location
    OKC
    Posts
    1,219
    That would work.

    Wow. That is one jacked up feed. They should really change that.
    ---
    This response was masterly crafted via the fingers of Patrick Allmond who believe you should StopDoingNothing starting today.
    ---
    Focus Consulting is where I roll | Follow @patrickallmond on Twitter
    Search Engine Marketing | Search Engine Optimization | Social Media | Online Video

  5. #5
    Full Member
    Join Date
    October 22nd, 2006
    Posts
    200
    Go to the code in post#8 in Dirk's thread and find the line:

    PHP Code:
    while($data fgetcsv($feed3000"\t")) 
    and change it to

    PHP Code:
    while($data fgetcsv($feed3000"|")) 
    where | is the symbol on the \ key.

    if that doesn't work try adding ,"\r\n" or ,"\r" or ,"\n" deprnding on wether td use carraige return or line feed or both at the end of the line.

    So the php would look like:

    PHP Code:
    while($data fgetcsv($feed3000"|","\r\n")) 

  6. #6
    Newbie
    Join Date
    April 5th, 2008
    Posts
    3
    Thanks all

    I've just got it going by removing the excess pipes, and as I wont be updating the feed too regularly, I'll stick with it for now.

    If I start to update regularly, i'll give Donks suggestion a go.

    I've gotta say, it's great to have found somewhere that has people willing to share knowledge.


    thanks again

  7. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Commas In CSV Feed
    By John Powell in forum AvantLink -AV
    Replies: 8
    Last Post: August 21st, 2008, 01:23 PM
  2. convert csv to rss feed?
    By knight01 in forum Programming / Datafeeds / Tools
    Replies: 4
    Last Post: April 11th, 2008, 02:09 AM
  3. FREE XML/CSV Feed Generator For Merchants
    By John Jupp in forum Midnight Cafe'
    Replies: 10
    Last Post: June 10th, 2007, 12:35 PM
  4. CSV Feed Comparison Software Required
    By John Jupp in forum Marketing Resources & Power Tools
    Replies: 5
    Last Post: February 28th, 2007, 05:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •