Interesting... using cf to modify cf files from a programming point of view.

If you're not talking about gb of files, I'd use an app designed for the job. 
Despite my confidence in my own programming, somehow I don't think I'd ever 
write a script to open every cf file, do a search and replace, then write the 
file back.

http://www.abacre.com/afr/

I used this program once years ago when upgrading an eight-year old collection 
of websites... literally a thousand plain html pages from ten interlinked 
interrelated sites, all referring to files and locations and urls that needed 
to be changed.  I stood with my toes up against this giant wall stretching up 
as high as the sun, from horizon to horizon and thought there's no way in hell 
I'm doing this by hand. I was able to do some pretty amazing s/r tricks with 
this app, one of which I set to run while I went to lunch. I did probably a 
months worth of work in an afternoon because of that app. Pretty much 
guaranteed my job security (it was my first week there).

Back everything up first, y'hear?

Mik


At 01:00 AM 2/12/2007, you wrote:
>reFind finds only one occurrence at a time. You need to loop over the
>file contents, doing the reFind() until the find doesn't find
>anything.
>
>On 2/12/07, AJ Mercer <[EMAIL PROTECTED]> wrote:
>> Hi All,
>>
>> I have a lot of cflocations in my application and I want to modify the URL
>> attribute
>> from:<cflocation url="#ATTRIBUTES.url#" addtoken="no">
>> to:    <cflocation url="#urlSessionFormat(ATTRIBUTES.url)#" addtoken="no">
>>
>> first off, any one know of an easy why to do it?
>>
>>
>> I am in the process of writing a cf script that gets all the files, reads
>> the files and then was planning on doing a regex find and then some funky
>> string manipulation to drop in the function.
>>
>> I have got to the refind part, but am struggling with the expression. This
>> is what I have
>>     <cfset x = refindNoCase("<CFLOCATION[^>]*>", fileContents, 0,true) />
>> but it seems to only be finding the first occurrence.
>
>-- 
>CFAJAX docs and other useful articles:
>http://www.bifrost.com.au/blog/
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:269490
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to