February 14, 200619 yr Hi To All, I am trying to parse some files into another format. It would really help if I could use a replace function that would search for a start occurence and an end occurence that could be defined and then replace anything in between with defined text. I found the following function SubstituteRange ( text; beginString; endString; replaceString ) at the following url http://www.briandunning.com/cf/122 (ps thanks to brian for all his cool functions) But cannot get it to work! Any help would be much appreciated Thanks, Lance
February 14, 200619 yr I also tested this one a few weeks ago, and it worked for me too. Maybe you can attach a sample of the text that isn't working for you, and maybe we can see what is not working better.. Lee
February 14, 200619 yr Author Hi Ender, How did I know I was going to get that as a response! : ) I have cut and paste the function 3-4 times changed various bits. The best I can get is it removes the search start text and the search end text along with anything in between. No replace is happening. Any thoughts would be much appreciated, I can't for the life of me see anything I am putting in wrong. : ( Thanks, Lance
February 14, 200619 yr Ah, there is an error in that CF. I had just tried it with an empty replacement string so I didn't see it (it helps to know what you're having trouble with.) This is the fix: ... Case( lenBegin > 0 and lenEnd > 0 and ptBegin > 0 and ptEnd > lenEnd; modText & replaceString & SubstituteRange(remainText; beginString; endString; replaceString); text))
February 14, 200619 yr Author Hi Lee, I am happy to post a file that has screen shots of what I am doing. It may give further info. I may be doing somthing really basic wrong. Thanks, Lance Example.pdf
February 14, 200619 yr Author Hey Ender, Just testing now and seems to be working great!! Thanks so much ; )
Create an account or sign in to comment