Results 1 to 10 of 10
  1. #1
    Full Member
    Join Date
    January 18th, 2005
    Posts
    310
    Ok, my petco feed has an \ in the image url which is causing some problems.

    Example -> http://www.petco.com/assets/product_...685106100B.jpg


    I thought something like this would clean it up, but it doesn't:

    UPDATE tbl SET product_image_url=replace(product_image_url,'\\', '');

    Any ideas?

  2. #2
    ABW Ambassador
    Join Date
    January 18th, 2005
    Posts
    545
    What program/language are you working with?

    in perl it would be:
    $url_var =~ s/\\/\/g;

    Untested but it should work.

  3. #3
    Full Member
    Join Date
    January 18th, 2005
    Posts
    310
    I can do it in either php or from a script from a ssh session.

  4. #4
    ABW Ambassador
    Join Date
    January 18th, 2005
    Posts
    545
    Terrymc

    I’m glad you can use ssh. You are now farther ahead then most computer geniuses.

    Do you know how to use vim?

    I'm going to start at the beginning and end at the end JIC you do not know how to use vim. When I say type "what i say to type", don't type the quotes.

    1. ssh to your site
    2. cd to the directory with the file you are trying to get the "\"s out of
    3. type "vi filename.htm" (replace filename with whatever the file is cuz vi does not care what kind of file it is, unless its binary which it's not and we can discus that in another thread)
    4. type "<shift>(hold down shift key) then type :" (this will put you at the bottom of the screen on the left)
    5. type "%s/\\/\//g"
    6. Hit <enter>

    This should replace all your "\"s with "/"s.

    Let me know if you get stuck with that I would be glad to help.

  5. #5
    Full Member
    Join Date
    January 18th, 2005
    Posts
    310
    Thanks Squiggie,

    Actually, here is what I do. I run a script to get the zip file from LS, then I unzip it to a text file, then I run an import script to the database, then I create static pages.

    So I really need an automated process, preferably, one that I could do via an SQL ??

    thanks for your help!!!

    Terry

  6. #6
    Full Member
    Join Date
    January 18th, 2005
    Posts
    256
    In your text file, do a find and replace ( "\" for "/" ).

  7. #7
    "An Englishman In New York" TJ's Avatar
    Join Date
    January 18th, 2005
    Posts
    3,282
    Terry, if you use the LOAD DATA LOCAL INFILE method of loading the data, you could try changing the escape character to say ^ as there are none of these in the feed

    (ESCAPED BY '^')

    Hope this is of some help... perhaps a REAL programmer can tell me why this is SOOOOO wrong

  8. #8
    "An Englishman In New York" TJ's Avatar
    Join Date
    January 18th, 2005
    Posts
    3,282
    Hey Terry, did this work out for you?

  9. #9
    Full Member
    Join Date
    January 18th, 2005
    Posts
    310
    Hi TJ,

    Thanks for the help.

    Petco responded to my email and they agreed that they shouldn't have that \ in the images, they said it was fixed in the latest upload.
    I don't see why your fix wouldn't work.

    Thanks!

  10. #10
    "An Englishman In New York" TJ's Avatar
    Join Date
    January 18th, 2005
    Posts
    3,282
    ah cool Good for everyone then... good work my friend!

  11. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Correcting image url paths
    By papabear in forum WebMerge (Fourthworld.com)
    Replies: 5
    Last Post: December 22nd, 2004, 12:28 AM
  2. Problem with Image URL
    By walton in forum WebMerge (Fourthworld.com)
    Replies: 4
    Last Post: June 24th, 2004, 10:21 AM
  3. Webmerge - Image URL Question
    By Cheesehead in forum Programming / Datafeeds / Tools
    Replies: 1
    Last Post: May 27th, 2004, 11:59 AM
  4. Bill Bam Missing Image Fix in Place
    By Chris - AMWSO in forum AMWSO
    Replies: 0
    Last Post: May 12th, 2004, 10:07 PM
  5. image and url redirects
    By Jim252 in forum Commission Junction - CJ
    Replies: 2
    Last Post: December 30th, 2002, 08:38 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
  •