Re: Replace Question
This is a case for Regular Expressions (RegEx): REReplaceNoCase(answer, '(#search_string#)', 'span class=keyword\1/span', 'all')# Heh, just seen this after the other thread, so guess I'll repeat what I said there: Using parentheses is completely unnecessary. Use \0 in the replacement string instead. If search_string is (for example) $10 or :) or a+b^c or whatever then simply using it as a regex_pattern will cause problems. To solve this means escaping the meta-characters, for example, search_string.replaceAll('[$^*()+\[\]{}.?\\|]','\\$0') Putting both those together results in: REReplaceNoCase ( answer , search_string.replaceAll('[$^*()+\[\]{}.?\\|]','\\$0') , 'span class=keyword\0/span' , 'all' ) (Though of course, as noted in the other thread, this doesn't deal with HTML.) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351787 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Replace Question
I have a search results pages and I'd like to highlight the search term to show the matches. Of course, search is not case sensitive. On the results I can do something like: ReplaceNoCase(answer, search_string,span class=keyword#search_string#/span,all)# This puts a nice little highlight around the search term and makes it easy to see in the results, but it may change the case. For example, if I search for mick jagger and it finds Mick Jagger, my answer come out like: ... and a mick jagger was guy with big lips who dreamed of being a Beatle... Is there a way I could do the replace to highlight the result and NOT change the case? Thanks, Robert Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351738 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Replace Question
I have a search results pages and I'd like to highlight the search term to show the matches. Of course, search is not case sensitive. On the results I can do something like: Better written results: #ReplaceNoCase(answer, search_string,span class=keyword search_string /span,all)# This puts a nice little highlight around the search term and makes it easy to see in the results, but it may change the case. For example, if I search for mick jagger and it finds Mick Jagger, my answer come out like: ... and a mick jagger was guy with big lips who dreamed of being a Beatle... Is there a way I could do the replace to highlight the result and NOT change the case? Thanks, Robert Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351739 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Replace Question
This is a case for Regular Expressions (RegEx): REReplaceNoCase(answer, '(#search_string#)', 'span class=keyword\1/span', 'all')# 1. Search the content of the variable answer 2. Look for the content of the variable search_string 2a. Because parenthesis are being used and we're doing RegEx, the matched text will be 'captured' for later use. The parenthesis are special characters, not part of what is being matched. 3. Replace the matched content with: span class=keyword\1/span 3a. take the captured text from the match and place it within the span block in place of the \1 \1 will contain the exact text matched with whatever case it had rather than the case of the search_string On Wed, Jun 27, 2012 at 2:25 PM, Robert Harrison rob...@austin-williams.com wrote: I have a search results pages and I'd like to highlight the search term to show the matches. Of course, search is not case sensitive. On the results I can do something like: ReplaceNoCase(answer, search_string,span class=keyword#search_string#/span,all)# This puts a nice little highlight around the search term and makes it easy to see in the results, but it may change the case. For example, if I search for mick jagger and it finds Mick Jagger, my answer come out like: ... and a mick jagger was guy with big lips who dreamed of being a Beatle... Is there a way I could do the replace to highlight the result and NOT change the case? Thanks, Robert Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351740 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Replace Question
# REReplaceNoCase(answer, '(#search_string#)', 'span class=keyword\1/span', 'all')# Nice. Works perfectly. Thank You... just waiting for someone to complain about the nested ##'s though LOL :-) Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351741 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Replace Question
Stop nesting #s!! You're needlessly killing kittens!!! :D #reReplaceNoCase( answer, search_string, 'span class=keyword\1/span', 'all' )# ;-) On Wed, Jun 27, 2012 at 1:51 PM, Robert Harrison rob...@austin-williams.com wrote: # REReplaceNoCase(answer, '(#search_string#)', 'span class=keyword\1/span', 'all')# Nice. Works perfectly. Thank You... just waiting for someone to complain about the nested ##'s though LOL :-) Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351742 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Replace Question
On Wed, Jun 27, 2012 at 2:51 PM, Robert Harrison rob...@austin-williams.com wrote: # REReplaceNoCase(answer, '(#search_string#)', 'span class=keyword\1/span', 'all')# Nice. Works perfectly. Thank You... just waiting for someone to complain about the nested ##'s though LOL :-) '(' search_string ')' I drop all attempts at being anal about #s when I'm working with RegEx. RegEx is anal enough. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351743 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Replace Question
Stop nesting #s. You're needlessly killing kittens!!! I was sooo waiting for that shoe to drop :-) Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351744 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Replace Question
I hope you noticed that I posted that _because_ you said you were waiting on it. ;-) On Wed, Jun 27, 2012 at 2:08 PM, Robert Harrison rob...@austin-williams.com wrote: Stop nesting #s. You're needlessly killing kittens!!! I was sooo waiting for that shoe to drop :-) Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351745 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Replace Question
Got it. Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_williams -Original Message- From: Matt Quackenbush [mailto:quackfu...@gmail.com] Sent: Wednesday, June 27, 2012 3:37 PM To: cf-talk Subject: Re: Replace Question I hope you noticed that I posted that _because_ you said you were waiting on it. ;-) On Wed, Jun 27, 2012 at 2:08 PM, Robert Harrison rob...@austin-williams.com wrote: Stop nesting #s. You're needlessly killing kittens!!! I was sooo waiting for that shoe to drop :-) Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351746 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Replace Question: Part II
# REReplaceNoCase(answer, '(#search_string#)', 'span class=keyword\1/span', 'all')# This works so wonderfully, I hate to ask a follow-up question, but I have to. Is there a way I can apply this everywhere EXCEPT when the matching content is in an HTML tag (like an HREF tag)? Sorry, but this level of Regex is a bit over my regex skill level. Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_wi ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351747 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Replace Question
Is there something in your CSS that is changing it to lower case? Eric Roberts Owner/Developer Three Ravens Consulting ow...@threeravensconsulting.com http://www.threeravensconsulting.com tel: 630-881-1515 -Original Message- From: Robert Harrison [mailto:rob...@austin-williams.com] Sent: Wednesday, June 27, 2012 1:30 PM To: cf-talk Subject: RE: Replace Question I have a search results pages and I'd like to highlight the search term to show the matches. Of course, search is not case sensitive. On the results I can do something like: Better written results: #ReplaceNoCase(answer, search_string,span class=keyword search_string /span,all)# This puts a nice little highlight around the search term and makes it easy to see in the results, but it may change the case. For example, if I search for mick jagger and it finds Mick Jagger, my answer come out like: ... and a mick jagger was guy with big lips who dreamed of being a Beatle... Is there a way I could do the replace to highlight the result and NOT change the case? Thanks, Robert Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351748 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
OT:SQL Replace Question
Anyone have any idea why this code will not strip out the spaces in the string N0P 2L0? select Replace(postal_code,' ', '') from location where id = 1009637 when I change the last argument to 'X' it throws two X's in like it should. We are running ms sql 2k in 6.5 compatibility mode, so I dont know if that is the reason why it wont trim the spaces out. If this is why, does anyone have a workaround that would work inside a join clause like oin zipinfo z on Replace(z.zip,' ','') = Replace(l.postal_code,' ','') when running in compatibility mode? TIA John ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:193102 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: SQL Replace Question
Well, I tested this and it works fine on a 2k db NOT running in compatability mode, so that is the issue. Now to find a workaround. -Original Message- From: John Stanley Sent: Friday, February 04, 2005 11:35 AM To: CF-Talk Subject: OT:SQL Replace Question Anyone have any idea why this code will not strip out the spaces in the string N0P 2L0? select Replace(postal_code,' ', '') from location where id = 1009637 when I change the last argument to 'X' it throws two X's in like it should. We are running ms sql 2k in 6.5 compatibility mode, so I dont know if that is the reason why it wont trim the spaces out. If this is why, does anyone have a workaround that would work inside a join clause like oin zipinfo z on Replace(z.zip,' ','') = Replace(l.postal_code,' ','') when running in compatibility mode? TIA John ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:193119 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: A replace question
Whoever said this was going public?? ;-) Actually, I used my MP3 folder to test the concept. What I need to do is remove the ..\ and the directory immediately before it in the list. I got that fixed, but thanks for the tip. -Original Message- From: Holger Lockertsen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 10, 2000 11:33 AM To: [EMAIL PROTECTED] Subject: RE: A replace question Remove "..\" this way: cfif string CONTAINS "..\" cfset string = Replace(string, "..\", "", "All") /cfif Serving MP3's on the web is illegal you know... ;-) * Holger Lockertsen, Solutions Developer, Horisont Information Systems AS * Nedre Slottsgate 5, N-0157 OSLO, Noreg/Norway * 23 31 03 04 / 91 83 20 51 * [EMAIL PROTECTED] http://www.horisont.no/ NB! Horisont har fått nye nummer, og mitt INTERNNUMMER er: 23 31 03 04 -Original Message- From: Russel Madere [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 10, 2000 5:45 PM To: CF Talk Mailing List Subject: A replace question How can I dynamically convert: d:\songs\..\drip\manual.txt to: d:\drip\manual.txt or: d:\Songs\Music\K\..\B\Buffett, Jimmy\Song.mp3 to: d:\Songs\Music\B\Buffett, Jimmy\Song.mp3 ? I'm having a complete brain lapse! Russel Madere, Jr. Web Developer TurboSquid "Be good and you will be lonesome. Be lonesome and you will be free. Live a lie and you will live to regret it." Jimmy Buffett That's What Living Is To Me -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebarRstsbodyRsts/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: A replace question
Well, as long as they're not Metallica MP3's ...:) -Original Message- From: Holger Lockertsen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 10, 2000 12:33 PM To: [EMAIL PROTECTED] Subject: RE: A replace question Remove "..\" this way: cfif string CONTAINS "..\" cfset string = Replace(string, "..\", "", "All") /cfif Serving MP3's on the web is illegal you know... ;-) * Holger Lockertsen, Solutions Developer, Horisont Information Systems AS * Nedre Slottsgate 5, N-0157 OSLO, Noreg/Norway * 23 31 03 04 / 91 83 20 51 * [EMAIL PROTECTED] http://www.horisont.no/ NB! Horisont har fått nye nummer, og mitt INTERNNUMMER er: 23 31 03 04 -Original Message- From: Russel Madere [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 10, 2000 5:45 PM To: CF Talk Mailing List Subject: A replace question How can I dynamically convert: d:\songs\..\drip\manual.txt to: d:\drip\manual.txt or: d:\Songs\Music\K\..\B\Buffett, Jimmy\Song.mp3 to: d:\Songs\Music\B\Buffett, Jimmy\Song.mp3 ? I'm having a complete brain lapse! Russel Madere, Jr. Web Developer TurboSquid "Be good and you will be lonesome. Be lonesome and you will be free. Live a lie and you will live to regret it." Jimmy Buffett That's What Living Is To Me -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
A replace question
How can I dynamically convert: d:\songs\..\drip\manual.txt to: d:\drip\manual.txt or: d:\Songs\Music\K\..\B\Buffett, Jimmy\Song.mp3 to: d:\Songs\Music\B\Buffett, Jimmy\Song.mp3 ? I'm having a complete brain lapse! Russel Madere, Jr. Web Developer TurboSquid "Be good and you will be lonesome. Be lonesome and you will be free. Live a lie and you will live to regret it." Jimmy Buffett That's What Living Is To Me -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
(OT) Re: A replace question
Only copyrighted ones =-p .Todd - Original Message - From: "Holger Lockertsen" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 10, 2000 12:33 PM Subject: RE: A replace question | Remove "..\" this way: | | cfif string CONTAINS "..\" | cfset string = Replace(string, "..\", "", "All") | /cfif | | Serving MP3's on the web is illegal you know... ;-) -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: A replace question
Use the Edit function on the menu and do Replace or Extended Replace if you are changing them within CFM files. If in a database then you will need to run an UPDATE query. - Original Message - From: "Russel Madere" [EMAIL PROTECTED] To: "CF Talk Mailing List" [EMAIL PROTECTED] Sent: Wednesday, May 10, 2000 11:45 AM Subject: A replace question How can I dynamically convert: d:\songs\..\drip\manual.txt to: d:\drip\manual.txt or: d:\Songs\Music\K\..\B\Buffett, Jimmy\Song.mp3 to: d:\Songs\Music\B\Buffett, Jimmy\Song.mp3 ? I'm having a complete brain lapse! Russel Madere, Jr. Web Developer TurboSquid "Be good and you will be lonesome. Be lonesome and you will be free. Live a lie and you will live to regret it." Jimmy Buffett That's What Living Is To Me -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: A replace question
Remove "..\" this way: cfif string CONTAINS "..\" cfset string = Replace(string, "..\", "", "All") /cfif Serving MP3's on the web is illegal you know... ;-) * Holger Lockertsen, Solutions Developer, Horisont Information Systems AS * Nedre Slottsgate 5, N-0157 OSLO, Noreg/Norway * 23 31 03 04 / 91 83 20 51 * [EMAIL PROTECTED] http://www.horisont.no/ NB! Horisont har fått nye nummer, og mitt INTERNNUMMER er: 23 31 03 04 -Original Message- From: Russel Madere [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 10, 2000 5:45 PM To: CF Talk Mailing List Subject: A replace question How can I dynamically convert: d:\songs\..\drip\manual.txt to: d:\drip\manual.txt or: d:\Songs\Music\K\..\B\Buffett, Jimmy\Song.mp3 to: d:\Songs\Music\B\Buffett, Jimmy\Song.mp3 ? I'm having a complete brain lapse! Russel Madere, Jr. Web Developer TurboSquid "Be good and you will be lonesome. Be lonesome and you will be free. Live a lie and you will live to regret it." Jimmy Buffett That's What Living Is To Me -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: A replace question
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. -- =_NextPart_001_01BFBAD3.69F193EE Content-Type: text/plain Subject: A replace question How can I dynamically convert: d:\songs\..\drip\manual.txt to: d:\drip\manual.txt try something like cfset uppos=listfind(pathstring,"..","\") cfif uppos gt 0 cfset pathstring=listdeleteat(pathstring,uppos,"\") cfset pathstring=listdeleteat(pathstring,(uppos-1),"\") /cfif or: d:\Songs\Music\K\..\B\Buffett, Jimmy\Song.mp3 to: d:\Songs\Music\B\Buffett, Jimmy\Song.mp3 ? I'm having a complete brain lapse! Russel Madere, Jr. Web Developer TurboSquid "Be good and you will be lonesome. Be lonesome and you will be free. Live a lie and you will live to regret it." Jimmy Buffett That's What Living Is To Me -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- =_NextPart_001_01BFBAD3.69F193EE Content-Type: text/html Content-Transfer-Encoding: quoted-printable !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN" HTML HEAD META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Dus-ascii" META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version = 5.5.1960.3" TITLERE: A replace question/TITLE /HEAD BODY PFONT SIZE=3D2gt; Subject: A replace question/FONT BRFONT SIZE=3D2gt;/FONT BRFONT SIZE=3D2gt;/FONT BRFONT SIZE=3D2gt; How can I dynamically convert:/FONT BRFONT SIZE=3D2gt;/FONT BRFONT SIZE=3D2gt; d:\songs\..\drip\manual.txt/FONT BRFONT SIZE=3D2gt;/FONT BRFONT SIZE=3D2gt; to:/FONT BRFONT SIZE=3D2gt;/FONT BRFONT SIZE=3D2gt; d:\drip\manual.txt/FONT BRFONT SIZE=3D2gt;/FONT BRFONT SIZE=3D2try something like/FONT /P PFONT SIZE=3D2lt;cfset = uppos=3Dlistfind(pathstring,quot;..quot;,quot;\quot;)gt;/FONT BRFONT SIZE=3D2lt;cfif uppos gt 0gt;/FONT BRFONT SIZE=3D2lt;cfset = pathstring=3Dlistdeleteat(pathstring,uppos,quot;\quot;)gt;/FONT BRFONT SIZE=3D2lt;cfset = pathstring=3Dlistdeleteat(pathstring,(uppos-1),quot;\quot;)gt;/FONT= BRFONT SIZE=3D2lt;/cfifgt;/FONT /P BR PFONT SIZE=3D2gt; or:/FONT BRFONT SIZE=3D2gt;/FONT BRFONT SIZE=3D2gt; d:\Songs\Music\K\..\B\Buffett, = Jimmy\Song.mp3/FONT BRFONT SIZE=3D2gt;/FONT BRFONT SIZE=3D2gt; to:/FONT BRFONT SIZE=3D2gt;/FONT BRFONT SIZE=3D2gt; d:\Songs\Music\B\Buffett, Jimmy\Song.mp3/FONT BRFONT SIZE=3D2gt;/FONT BRFONT SIZE=3D2gt; ?/FONT BRFONT SIZE=3D2gt;/FONT BRFONT SIZE=3D2gt; I'm having a complete brain lapse!/FONT BRFONT SIZE=3D2gt;/FONT BRFONT SIZE=3D2gt;/FONT BRFONT SIZE=3D2gt; Russel Madere, Jr./FONT BRFONT SIZE=3D2gt; Web Developer/FONT BRFONT SIZE=3D2gt; TurboSquid/FONT BRFONT SIZE=3D2gt;/FONT BRFONT SIZE=3D2gt; quot;Be good and you will be lonesome./FONT BRFONT SIZE=3D2gt;nbsp; Be lonesome and you will be free./FONT BRFONT SIZE=3D2gt;nbsp; Live a lie and you will live to regret = it.quot;/FONT BRFONT = SIZE=3D2gt;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp= ;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp= ;nbsp;nbsp;nbsp;nbsp; Jimmy Buffett/FONT BRFONT = SIZE=3D2gt;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp= ;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp= ;nbsp;nbsp;nbsp;nbsp; That's What Living Is To Me/FONT BRFONT SIZE=3D2gt; = --/FONT= BRFONT SIZE=3D2gt; /FONT BRFONT SIZE=3D2gt; Archives: A = HREF=3D"http://www.eGroups.com/list/cf-talk" = TARGET=3D"_blank"http://www.eGroups.com/list/cf-talk/A/FONT BRFONT SIZE=3D2gt; To Unsubscribe visit/FONT BRFONT SIZE=3D2A = HREF=3D"http://www.houseoffusion.com/index.cfm?sidebar=3Dlistsbody=3Dli= sts/cf_talk" = TARGET=3D"_blank"http://www.houseoffusion.com/index.cfm?sidebar=3Dlists= body=3Dlists/cf_talk/A or/FONT BRFONT SIZE=3D2send a message to [EMAIL PROTECTED] = with 'unsubscribe' in/FONT BRFONT SIZE=3D2the body./FONT /P BR PFONT = SIZE=3D2---= -/FONT BRFONT SIZE=3D2--/
[Solved] A replace question
I solved the problem. What I did was create a includable file act_DirectoryClean.cfm which contains: = cfset deleteAt = ListFind(list, "..", "\") cfset list = ListDeleteAt(list, "#deleteAt#", "\") cfset list = ListDeleteAt(list, "#Evaluate("deleteAt - 1")#", "\") cfif ListContains(list, "..", "\") cfinclude template="act_DirectoryClean.cfm" /cfif = Then in my main page, I had this code: = cfif ListContains(URL.id, "..", "\") cfset list = URL.id cfinclude template="act_DirectoryClean.cfm" /cfif = Original message: How can I dynamically convert: d:\songs\..\drip\manual.txt to: d:\drip\manual.txt or: d:\Songs\Music\K\..\B\Buffett, Jimmy\Song.mp3 to: d:\Songs\Music\B\Buffett, Jimmy\Song.mp3 ? I'm having a complete brain lapse! Russel Madere, Jr. Web Developer TurboSquid "Be good and you will be lonesome. Be lonesome and you will be free. Live a lie and you will live to regret it." Jimmy Buffett That's What Living Is To Me -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.