Seperating a text field


i have following data:

 

1/rgrgrrtr,2/xcvxcvxcvx,3/cccc,4/thtryrytrytry,5/cvbzxcbb,6/eeeeeeeeeeeeeeee,7/nnnnnnnnnn nnnnnnnn

 

i can seperate above values on / using the:

 

<cfloop index = "listelement" list = "#nenen#" delimiters = ",">

 

</cfloop>

 

the above produce:

1/rgrgrrtr

2/xcvxcvxcvx

3/cccc

4/thtryrytrytry

5/cvbzxcbb

6/eeeeeeeeeeeeeeee

7/nnnnnnnnnnnnnnnnnn

 

i need seperate each value based on /. placing value before / in variable , value after / in variable. have not found cold fusion function this.

 

the value before / can more 1 character in length.

 

the value before / compared against value contains record number.

 

 

thanks.

how treating resulting elements list (delimited forward slash):

 

<cfset itemid = "">

<cfset itemvalue = "">

<cfloop index = "listelement" list = "#nenen#" delimiters = ",">

<cfset itemid = listfirst(listelement, "/")>

<cfset itemvalue = listlast(listelement, "/")

<!--- comparison stuff here --->

 

</cfloop>

 

hth,

carl v.



More discussions in ColdFusion


adobe

Comments