Re: String manipulation
Hi all, How can extract only the files with the following file extensions ".96" from the string below and display the results as Output: 1.96,2.96 test1.txt,test2.txt,test3.txt,file1.96,test4.in,test5.dat,file2.96,file3.96,test6.dat,test5.doc,test5.jb ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: String manipulation
If you got this list from a CFDIRECTORY tag, you may want to use the FILTER option instead to automatically only return files named .96. As for finding elements in a list that match ".96" (and match at the END), there are a variety of ways. Here is one: good one You need the listlen because ListLast(Item,".") will return true if the item is JUST 96, not .96. === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 21, 2001 9:49 AM > To: CF-Talk > Subject: Re: String manipulation > > > Hi all, > > > How can extract only the files with the following file > extensions ".96" > from the string below and display the results as > > Output: > 1.96,2.96 > > > test1.txt,test2.txt,test3.txt,file1.96,test4.in,test5.dat,file > 2.96,file3.96,test6.dat,test5.doc,test5.jb > ~~ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: String manipulation
How can I display the filenames with the .96 extensions from the CFLOOP. Right now it just displays... good one good one I need file1.96 file2.96 At 10:06 AM 9/21/01 -0400, you wrote: >If you got this list from a CFDIRECTORY tag, you may want to use the >FILTER option instead to automatically only return files named .96. >As for finding elements in a list that match ".96" (and match at the >END), there are a variety of ways. Here is one: > > > > good one > > > >You need the listlen because ListLast(Item,".") will return true if the >item is JUST 96, not .96. > >=== >Raymond Camden, Principal Spectra Compliance Engineer for Macromedia > >Email: [EMAIL PROTECTED] >Yahoo IM : morpheus > >"My ally is the Force, and a powerful ally it is." - Yoda > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > Sent: Friday, September 21, 2001 9:49 AM > > To: CF-Talk > > Subject: Re: String manipulation > > > > > > Hi all, > > > > > > How can extract only the files with the following file > > extensions ".96" > > from the string below and display the results as > > > > Output: > > 1.96,2.96 > > > > > > test1.txt,test2.txt,test3.txt,file1.96,test4.in,test5.dat,file > > 2.96,file3.96,test6.dat,test5.doc,test5.jb > > > ~~ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: String manipulation
Nevermind. I got it to display the filenames. Thanks for your help Raymond. At 10:06 AM 9/21/01 -0400, you wrote: >If you got this list from a CFDIRECTORY tag, you may want to use the >FILTER option instead to automatically only return files named .96. > >As for finding elements in a list that match ".96" (and match at the >END), there are a variety of ways. Here is one: > > > > good one > > > >You need the listlen because ListLast(Item,".") will return true if the >item is JUST 96, not .96. > >=== >Raymond Camden, Principal Spectra Compliance Engineer for Macromedia > >Email: [EMAIL PROTECTED] >Yahoo IM : morpheus > >"My ally is the Force, and a powerful ally it is." - Yoda > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > Sent: Friday, September 21, 2001 9:49 AM > > To: CF-Talk > > Subject: Re: String manipulation > > > > > > Hi all, > > > > > > How can extract only the files with the following file > > extensions ".96" > > from the string below and display the results as > > > > Output: > > 1.96,2.96 > > > > > > test1.txt,test2.txt,test3.txt,file1.96,test4.in,test5.dat,file > > 2.96,file3.96,test6.dat,test5.doc,test5.jb > > > ~~ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: String manipulation
Oh, notice the INDEX="item" code? This says, for every item in the loop, create a variable named "item". That's why I check the value of item. So, to display it, just add: #Item# === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 21, 2001 10:23 AM > To: CF-Talk > Subject: RE: String manipulation > > > How can I display the filenames with the .96 extensions from > the CFLOOP. Right now it just displays... > > good one > good one > > I need > > file1.96 > file2.96 > > At 10:06 AM 9/21/01 -0400, you wrote: > >If you got this list from a CFDIRECTORY tag, you may want to use the > >FILTER option instead to automatically only return files named .96. > > >As for finding elements in a list that match ".96" (and match at the > >END), there are a variety of ways. Here is one: > > > > > > > > good one > > > > > > > >You need the listlen because ListLast(Item,".") will return > true if the > >item is JUST 96, not .96. > > > >= > == > >Raymond Camden, Principal Spectra Compliance Engineer for Macromedia > > > >Email: [EMAIL PROTECTED] > >Yahoo IM : morpheus > > > >"My ally is the Force, and a powerful ally it is." - Yoda > > > > > -Original Message- > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > > Sent: Friday, September 21, 2001 9:49 AM > > > To: CF-Talk > > > Subject: Re: String manipulation > > > > > > > > > Hi all, > > > > > > > > > How can extract only the files with the following file extensions > > > ".96" from the string below and display the results as > > > > > > Output: > > > 1.96,2.96 > > > > > > > > > test1.txt,test2.txt,test3.txt,file1.96,test4.in,test5.dat,file > > > 2.96,file3.96,test6.dat,test5.doc,test5.jb > > > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: String manipulation
Hi, I would like to split the following line into two strings. The length or contents of the string can vary depending on the directory structure. Basically, I need to extract the directory path into one variable and the filename in another. Example: URL.filename in my template generates the line below. D:\books\aosl\act_text.dat I need to extract the above into two variables. var1 = D:\books\aosl ~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: String manipulation
See GetDirectoryFromPath() and GetFileFromPath() At 04:16 AM 10/19/2001, you wrote: >Hi, > >I would like to split the following line into two strings. The length or >contents of the string can vary depending on the directory structure. >Basically, I need to extract the directory path into one variable and the >filename in another. > >Example: > >URL.filename in my template generates the line below. > >D:\books\aosl\act_text.dat > >I need to extract the above into two variables. > >var1 = D:\books\aosl > ~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: String manipulation
There are functions available to do this for you... getdirectoryfrompath(path) - Extracts a the full directory (including \) from a full path and filename. getfilefrompath(path) - Extracts the filename from a full path and filename. -Justin Scott, Lead Developer Sceiron Internet Services, Inc. http://www.sceiron.com - Original Message - From: "phumes1" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, October 18, 2001 11:16 AM Subject: Re: String manipulation > Hi, > > I would like to split the following line into two strings. The length or > contents of the string can vary depending on the directory structure. > Basically, I need to extract the directory path into one variable and the > filename in another. > > Example: > > URL.filename in my template generates the line below. > > D:\books\aosl\act_text.dat > > I need to extract the above into two variables. > > var1 = D:\books\aosl > ~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: String manipulation
> It would be great if you could help me out..give me some sample code..names > of functions taht I will need to do this..or all of the above..thanks :-) These are what I call the "string operator" functions. You will need most of these. http://cfhub.com/language/INDEX.CFM?Cat=String%20Operators Also, pull the whole file with CFHTTP, and save it. then just use CFFILE for the rest. Of particular interest are the Find() and mid() functions. This is a script that pulls/parses data: http://cfhub.com/advanced/cfhttp/post.cfm and I have many more : ) Parsing is kind of a hobby of mine... If you like, email me off list... [EMAIL PROTECTED] ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: String manipulation
Thanks for that, I know most of the string functions...but how do I do a mid (string,start,end) which starts at the beginning of a line, and gets a copy of the complete line...and then repeat this for every line in the text file?? I guess i don't know how I can determine thevales for the start, end params. Any ideas? >From: "Joseph Thompson" <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: CF-Talk <[EMAIL PROTECTED]> >Subject: Re: String manipulation >Date: Tue, 12 Dec 2000 17:05:39 -0800 > > > It would be great if you could help me out..give me some sample >code..names > > of functions taht I will need to do this..or all of the above..thanks >:-) > >These are what I call the "string operator" functions. You will need most >of these. >http://cfhub.com/language/INDEX.CFM?Cat=String%20Operators > >Also, pull the whole file with CFHTTP, and save it. then just use CFFILE >for >the rest. > >Of particular interest are the Find() and mid() functions. > >This is a script that pulls/parses data: >http://cfhub.com/advanced/cfhttp/post.cfm > >and I have many more : ) Parsing is kind of a hobby of mine... > >If you like, email me off list... > [EMAIL PROTECTED] > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: String manipulation
If you're trying to parse a text file line by line, it's typically done by looping over the file, as a list, using an appropriate EOL character(s) as the delimiter. In this case I'll use ASCII character 13, the carriage return. Try something like this (if it's what you need): Line #int_count#: #idx# Steve -Original Message- From: Martin S [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 11:04 PM To: CF-Talk Subject: Re: String manipulation Thanks for that, I know most of the string functions...but how do I do a mid (string,start,end) which starts at the beginning of a line, and gets a copy of the complete line...and then repeat this for every line in the text file?? I guess i don't know how I can determine thevales for the start, end params. Any ideas? >From: "Joseph Thompson" <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: CF-Talk <[EMAIL PROTECTED]> >Subject: Re: String manipulation >Date: Tue, 12 Dec 2000 17:05:39 -0800 > > > It would be great if you could help me out..give me some sample >code..names > > of functions taht I will need to do this..or all of the above..thanks >:-) > >These are what I call the "string operator" functions. You will need most >of these. >http://cfhub.com/language/INDEX.CFM?Cat=String%20Operators > >Also, pull the whole file with CFHTTP, and save it. then just use CFFILE >for >the rest. > >Of particular interest are the Find() and mid() functions. > >This is a script that pulls/parses data: >http://cfhub.com/advanced/cfhttp/post.cfm > >and I have many more : ) Parsing is kind of a hobby of mine... > >If you like, email me off list... > [EMAIL PROTECTED] > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: String manipulation
Thanks again, That looks closer to what I want.. ...so when in the loop how do I parse the current line.. eg..check the current line for certain characters, and if it passes the check I copy the string to a new entry in an array. >From: "Steve Bernard" <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: CF-Talk <[EMAIL PROTECTED]> >Subject: RE: String manipulation >Date: Wed, 13 Dec 2000 00:56:36 -0500 > >If you're trying to parse a text file line by line, it's typically done by >looping over the file, as a list, using an appropriate EOL character(s) as >the delimiter. In this case I'll use ASCII character 13, the carriage >return. > >Try something like this (if it's what you need): > > > > > > > > Line #int_count#: #idx# > > > > >Steve > >-Original Message----- >From: Martin S [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, December 12, 2000 11:04 PM >To: CF-Talk >Subject: Re: String manipulation > > > >Thanks for that, > >I know most of the string functions...but how do I do a mid >(string,start,end) which starts at the beginning of a line, and gets a copy >of the complete line...and then repeat this for every line in the text >file?? I guess i don't know how I can determine thevales for the start, >end >params. > >Any ideas? > > > > > > >From: "Joseph Thompson" <[EMAIL PROTECTED]> > >Reply-To: [EMAIL PROTECTED] > >To: CF-Talk <[EMAIL PROTECTED]> > >Subject: Re: String manipulation > >Date: Tue, 12 Dec 2000 17:05:39 -0800 > > > > > It would be great if you could help me out..give me some sample > >code..names > > > of functions taht I will need to do this..or all of the above..thanks > >:-) > > > >These are what I call the "string operator" functions. You will need >most > >of these. > >http://cfhub.com/language/INDEX.CFM?Cat=String%20Operators > > > >Also, pull the whole file with CFHTTP, and save it. then just use CFFILE > >for > >the rest. > > > >Of particular interest are the Find() and mid() functions. > > > >This is a script that pulls/parses data: > >http://cfhub.com/advanced/cfhttp/post.cfm > > > >and I have many more : ) Parsing is kind of a hobby of mine... > > > >If you like, email me off list... > > [EMAIL PROTECTED] > > > > > > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: String manipulation
Martin wrote: > ...so when in the loop how do I parse the current line.. > > eg..check the current line for certain characters, and if it passes the > check I copy the string to a new entry in an array. Try this within the loop Steve suggested: That's assuming you want to capture the whole line. Also note that a structure might be an easier solution than an array unless you need the multi-dimensionality. If you use an array, don't forget to define it prior to the loop with ArrayNew(x) where x is the number of required dimensions. Valid numbers are 1-3. Charles [EMAIL PROTECTED] ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: String Manipulation troubles
First off,trim your var in the if statement and then change the "IS" to "eq". I have had this problem before and by always trimming my vars and using eq instead of is, I have had far less problems like this. HTH Clint -- Original Message -- from: Brian Scandale <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] date: Wed, 26 Jun 2002 00:49:35 -0700 Why doesn't this statement catch the "]" character? Or a better question is How do i branch on that character... chr(93) doesn't work either. temp = #temp# temp = #temp# Yep It Works! __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: String Manipulation troubles
Just to make sure it was an email-only typo You did not close the cfset tag with a > Jerry Johnson >>> [EMAIL PROTECTED] 06/26/02 11:09AM >>> First off,trim your var in the if statement and then change the "IS" to "eq". I have had this problem before and by always trimming my vars and using eq instead of is, I have had far less problems like this. HTH Clint -- Original Message -- from: Brian Scandale <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] date: Wed, 26 Jun 2002 00:49:35 -0700 Why doesn't this statement catch the "]" character? Or a better question is How do i branch on that character... chr(93) doesn't work either. temp = #temp# temp = #temp# Yep It Works! __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: String Manipulation troubles
It works for me Ade -Original Message- From: Brian Scandale [mailto:[EMAIL PROTECTED]] Sent: 26 June 2002 08:50 To: CF-Talk Subject: String Manipulation troubles Why doesn't this statement catch the "]" character? Or a better question is How do i branch on that character... chr(93) doesn't work either. temp = #temp# temp = #temp# Yep It Works! __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: String Manipulation troubles
Tried it Clint, see below... It does NOT test True for the Square Bracket. Does this have something to do with Regular Expressions? What's the proper way to test for the ] character? temp = #temp# temp = #temp# Yep It Works! At 08:09 AM 6/26/02, you wrote: >First off,trim your var in the if statement and then change the "IS" to "eq". I have >had this problem before and by always trimming my vars and using eq instead of is, I >have had far less problems like this. > >HTH >Clint > >-- Original Message -- >from: Brian Scandale <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >date: Wed, 26 Jun 2002 00:49:35 -0700 > >Why doesn't this statement catch the "]" character? > >Or a better question is How do i branch on that character... chr(93) doesn't work >either. > > >temp = #temp# > > >temp = #temp# Yep It Works! > > > > __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: String Manipulation troubles
Right... an email typo indeed ;-( At 09:01 AM 6/26/02, you wrote: >Just to make sure it was an email-only typo > >You did not close the cfset tag with a > > >Jerry Johnson > [EMAIL PROTECTED] 06/26/02 11:09AM >>> >First off,trim your var in the if statement and then change the "IS" to "eq". I have >had this problem before and by always trimming my vars and using eq instead of is, I >have had far less problems like this. > >HTH >Clint > >-- Original Message -- >from: Brian Scandale <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >date: Wed, 26 Jun 2002 00:49:35 -0700 > >Why doesn't this statement catch the "]" character? > >Or a better question is How do i branch on that character... chr(93) doesn't work >either. > > >temp = #temp# > > >temp = #temp# Yep It Works! > > > > > __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: String Manipulation troubles
Sorry All Stupid Operator Error: It works... I just can't read. That's what I get for 2am morning sessions. Brian At 09:05 AM 6/26/02, you wrote: >It works for me > >Ade > >-Original Message- >From: Brian Scandale [mailto:[EMAIL PROTECTED]] >Sent: 26 June 2002 08:50 >To: CF-Talk >Subject: String Manipulation troubles > > >Why doesn't this statement catch the "]" character? > >Or a better question is How do i branch on that character... chr(93) doesn't >work either. > > >temp = #temp# > > >temp = #temp# Yep It Works! > > > > __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: String Manipulation troubles
According to the documentation, IS and EQ do exactly the same thing, just like IS NOT and NEQ are aliases of one another. Same goes for GREATER THAN and GT, etc.. -Justin Scott, Lead Developer Sceiron Internet Services, Inc. http://www.sceiron.com - Original Message - From: "Clint Tredway" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Wednesday, June 26, 2002 11:09 AM Subject: Re: String Manipulation troubles > First off,trim your var in the if statement and then change the "IS" to "eq". I have had this problem before and by always trimming my vars and using eq instead of is, I have had far less problems like this. > > HTH > Clint > > -- Original Message -- > from: Brian Scandale <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > date: Wed, 26 Jun 2002 00:49:35 -0700 > > Why doesn't this statement catch the "]" character? > > Or a better question is How do i branch on that character... chr(93) doesn't work either. > > > temp = #temp# > > > temp = #temp# Yep It Works! > > > > __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: String Manipulation help needed
Try this, ListFirst("http://www.foobar.com/images/screwy.gif";, "/") Dave - Original Message - From: "Tim Claremont" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Tuesday, April 23, 2002 2:59 PM Subject: String Manipulation help needed I have the following string: http://www.foobar.com/images/screwy.gif I want to return everything before the third / In other words, I want to retrieve the following: http://www.foobar.com I am sure there is a simple string function. What am I missing? T __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: String Manipulation help needed
Is it just for this string? If so...#Left(string,21)# ...should do it. If for any url (return everything before the third "/"): then...#Left(sting,Left("/",string,8))# ...should do it. Ryan -Original Message- From: Tim Claremont [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 3:00 PM To: CF-Talk Subject: String Manipulation help needed I have the following string: http://www.foobar.com/images/screwy.gif I want to return everything before the third / In other words, I want to retrieve the following: http://www.foobar.com I am sure there is a simple string function. What am I missing? T __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: String Manipulation help needed
No - that will return "http: This will work better: http://www.cflib.org/foo/goo.html";> http://[^/]*)/.*"> #x# === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -Original Message- > From: Dave Hannum [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 23, 2002 3:14 PM > To: CF-Talk > Subject: Re: String Manipulation help needed > > > Try this, > > ListFirst("http://www.foobar.com/images/screwy.gif";, "/") > > Dave > > > - Original Message - > From: "Tim Claremont" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Tuesday, April 23, 2002 2:59 PM > Subject: String Manipulation help needed > > > I have the following string: > http://www.foobar.com/images/screwy.gif I want to return everything before the third / In other words, I want to retrieve the following: http://www.foobar.com I am sure there is a simple string function. What am I missing? T __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: String Manipulation help needed
http://www.foobar.com/images/screwy.gif";> #myURL# This code will do it. You can use the "/" as list delimiters, in which you're just grabbing the first two items in the list into a variable. Keep in mind that you're not using the 1st and 3rd item in the list because ColdFusion doesn't include empty list items in its count. Eric -Original Message- From: Tim Claremont [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 3:00 PM To: CF-Talk Subject: String Manipulation help needed I have the following string: http://www.foobar.com/images/screwy.gif I want to return everything before the third / In other words, I want to retrieve the following: http://www.foobar.com I am sure there is a simple string function. What am I missing? T __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: String Manipulation help needed
Or you could just use the CGI structure to grab info about the host name. I think the one you want is cgi.http_host. - Matt Small -Original Message- From: Dave Hannum [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 3:14 PM To: CF-Talk Subject: Re: String Manipulation help needed Try this, ListFirst("http://www.foobar.com/images/screwy.gif";, "/") Dave - Original Message - From: "Tim Claremont" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Tuesday, April 23, 2002 2:59 PM Subject: String Manipulation help needed I have the following string: http://www.foobar.com/images/screwy.gif I want to return everything before the third / In other words, I want to retrieve the following: http://www.foobar.com I am sure there is a simple string function. What am I missing? T __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: String Manipulation help needed
Thanks Ray, that one did the trick. I won't even tell ya what I was trying to use... -Original Message- From: Raymond Camden [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 3:21 PM To: CF-Talk Subject: RE: String Manipulation help needed No - that will return "http: This will work better: http://www.cflib.org/foo/goo.html";> http://[^/]*)/.*"> #x# === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -Original Message- > From: Dave Hannum [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 23, 2002 3:14 PM > To: CF-Talk > Subject: Re: String Manipulation help needed > > > Try this, > > ListFirst("http://www.foobar.com/images/screwy.gif";, "/") > > Dave > > > - Original Message - > From: "Tim Claremont" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Tuesday, April 23, 2002 2:59 PM > Subject: String Manipulation help needed > > > I have the following string: > http://www.foobar.com/images/screwy.gif I want to return everything before the third / In other words, I want to retrieve the following: http://www.foobar.com I am sure there is a simple string function. What am I missing? T __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists