How about this:
<cfset dbQuery="12_0,13_1,14_4,34_5"/>
<cfset varArray = arraynew(2) />
<cfset i = 1 />
<cfset j = 1 />
<cfloop index = "element" list = #dbQuery#>
<cfloop index = "single" list = #element# delimiters="_">
<cfset varArray[i][j] = "#single#"/>
<cfset j = j + 1/>
</cfloop>
<cfset i = i + 1 />
<cfset j = 1 />
</cfloop>
<cfdump var="#varArray#"/>
-----Original Message-----
From: Seth Kovanic [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 1 August 2007 7:18 AM
To: CF-Newbie
Subject: Search for a character in a string then grab what is before the
character
Hi All,
I have the following in a field in a DB
12_0,13_1,14_4,34_5 etc. I want to be able to search that field and store
for example on the first set of numbers both the 12 and the 0 in two unique
variables.
I know I need to setup a loop to accomplish this, but I am uncertain how to
setup a search within the string. I basically need to filter out the two
numbers and setup them up in two unique variables to then insert them into
another db.
Any ideas ?
Thanks !
p.s. I may have created a thread similar to this, and if I did I apologize.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8
Archive:
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2965
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15