Results 1 to 13 of 13
  1. #1
    Newbie
    Join Date
    January 16th, 2007
    Posts
    14
    Using Replace Tag
    Hi,
    Could someone help...

    When generating pagename from field :
    Canary £30
    I get :
    Canary--pound-30.php
    Exactly what i want...But

    when i try to create a link to the page in my tempate file, i keep getting either Canary-30.php or Canary--pound;30.php depending on how i write the replace tag

    does anyone have a clue as to how i can write the replace tag in order that it will generate the link

    Cheers
    Andy

  2. #2
    ABW Ambassador AWaR's Avatar
    Join Date
    January 18th, 2005
    Location
    Scotland
    Posts
    625
    one way to do it would be to split the £ before it can change into a sign...

    try this...

    replace(" &","--";"pound;","pound-")

    that should work
    "Yesterday we obeyed kings and bent our necks before emperors. But today we kneel only to truth..." - Kahlil Gibran

  3. #3
    Newbie
    Join Date
    January 16th, 2007
    Posts
    14
    Cheers for your help AWaR
    when using your suggestion i get this...

    Canary--;30.php

    it seems to be the ; that is giving me the problem, I just can't work out how to convert the ; to a -

    I've tried loads of variations but nothing seems to be working...

    is it that WebMerge cannot differenciate what a ; is when using it in replace?

    This is driving me crazzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzy

    anymore sugestions would be appreciated

    Thanks

  4. #4
    ABW Ambassador AWaR's Avatar
    Join Date
    January 18th, 2005
    Location
    Scotland
    Posts
    625
    sorry about that last one not working... i was trying to do things from memory... and as you seen... it failed...

    this result is tried and tested and it will definately work 100%

    replace("pound;","pound-";" &","--";"- ","-")

    i'm thinking that the ; problem was due to webmerge actually using the same character as a seperator for multiple replacement parameters, so i've put it first in the queue so it doesn't get confused...

    the last thing to replace is "- ","-" because without it, there is a space generated right before the 30, and you don't want that...
    Last edited by AWaR; June 24th, 2007 at 06:17 PM.
    "Yesterday we obeyed kings and bent our necks before emperors. But today we kneel only to truth..." - Kahlil Gibran

  5. #5
    Newbie
    Join Date
    January 16th, 2007
    Posts
    14
    Cheers again AWaR for your help, I know you said this would be 100% but...

    replace("pound;","pound-";" &","--";"- ","-")

    Gives the same result as last time...

    Canary--;30.php

    Any more suggestions would be appreciated...


    Anyone else had this problem?
    If so did you solve it?

  6. #6
    Newbie
    Join Date
    June 17th, 2007
    Posts
    21
    try this:
    Code:
    replace("pound;", "pound-", " &", "--", "- ", ";", "-")
    btw, what language is this or is this something related to WebMerge?

  7. #7
    Newbie
    Join Date
    January 16th, 2007
    Posts
    14
    Cheers DataFeedr.Com,
    that gives me...

    Canary%20&;30.php

    This is related to Webmerge...

  8. #8
    Newbie
    Join Date
    June 17th, 2007
    Posts
    21
    Quote Originally Posted by a-n-d-y
    Cheers DataFeedr.Com,
    that gives me...

    Canary%20&;30.php

    This is related to Webmerge...
    Hmmm... can you send me the documentation for using that replace() function?

    That will help me figure it out.

  9. #9
    ABW Ambassador AWaR's Avatar
    Join Date
    January 18th, 2005
    Location
    Scotland
    Posts
    625
    a-n-d-y... it definately worked for me...

    i've attached the test stuff i used (3 line datafeed, template, webmerge settings and the resulting page) in a .zip file, and you'll find that it does exactly as it should do...

    remember to scan the file for virus before opening it, even tho i keep my machines 99.99% clean
    Attached Files Attached Files
    "Yesterday we obeyed kings and bent our necks before emperors. But today we kneel only to truth..." - Kahlil Gibran

  10. #10
    Newbie
    Join Date
    January 16th, 2007
    Posts
    14
    well AWaR we're nearly there, very useful of you to send file...Ive noticed that you have

    Canary £ 30 in your datafeed

    I Have

    Canary £30 - Note there is no space between the £ and the 30
    could this be the problem?

    my data feed is csv but makes no difference when i converted to tab...

    I must say a big thankyou for your time and patience

  11. #11
    Newbie
    Join Date
    January 16th, 2007
    Posts
    14
    DataFeedr.Com
    The replace attribute is a simple - when your not havin probs like me -
    function that tells WebMerge to replace any instances of the string in findString with the value in replaceString for the specified field.

    Each findString and replaceString can be any string of characters contained within quotation marks and separated by commas. You can include quote and comma characters by using the contants "quote" and "comma", respectively, concatenating with the "&" character as needed.

    For example, if your fied data contained:

    He said Hello World
    ...then this:

    [WM-Field: MyField replace("Hello World", quote&"Hello"&comma&" World!"&quote)]

    ...would generate this HTML:

    He said "Hello, World!"
    You can have any number of comma-separated find-and replace pairs between the parentheses, each pair separated by semi-colons:

    [WM-Field: MyField replace("find","replace";"/","-")]

  12. #12
    ABW Ambassador AWaR's Avatar
    Join Date
    January 18th, 2005
    Location
    Scotland
    Posts
    625
    Quote Originally Posted by a-n-d-y
    well AWaR we're nearly there, very useful of you to send file...Ive noticed that you have

    Canary £ 30 in your datafeed

    I Have

    Canary £30 - Note there is no space between the £ and the 30
    could this be the problem?

    my data feed is csv but makes no difference when i converted to tab...

    I must say a big thankyou for your time and patience
    I've had another look at it, and removed the space... ran it through it again, and it was still in working order without any ; in it...

    you are using the "raw" attribute ? yes ?
    Last edited by AWaR; June 27th, 2007 at 05:04 PM.
    "Yesterday we obeyed kings and bent our necks before emperors. But today we kneel only to truth..." - Kahlil Gibran

  13. #13
    Newbie
    Join Date
    January 16th, 2007
    Posts
    14
    yes...I just copy and pasted yours...

  14. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. How can I replace commas. Replace wont' do it
    By sotonman in forum WebMerge (Fourthworld.com)
    Replies: 8
    Last Post: April 25th, 2007, 04:37 AM
  2. Replace Tag
    By misterdave in forum WebMerge (Fourthworld.com)
    Replies: 1
    Last Post: February 26th, 2007, 11:58 AM
  3. removing " in a text field with replace tag
    By epicadventures in forum WebMerge (Fourthworld.com)
    Replies: 13
    Last Post: February 23rd, 2004, 06:44 PM
  4. Can we replace _top with _bank in the target section of a tag
    By Doug247 in forum Rakuten LinkShare - LS
    Replies: 8
    Last Post: June 26th, 2003, 03:31 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
  •