Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfexecute variable dump

Status
Not open for further replies.

LAdProg2005

Programmer
Feb 20, 2006
56
US
hello,

i needed path forward in regards to how to parse through data in variable from cfexecute.

after cfexecute is successful, my variable has following data when i do cfdump or cfoutput:

fruits
apple banana
peach orange
veg
beans eggplant
drinks
coke pepsi
drinks
fanta

i am having trouble looping through the list. i want to parse through and put it in table to format it nicely for example
1) look for fruits and print uptil veg title is found
fruits
apple
banana
peach
orange

veg
beans
eggplant

drinks
2) drinks is listed twice (one of it needs to be removed)
drinks
coke pepsi
drinks
fanta

becomes
drinks
coke
pepsi
fanta

any pointers will be helpful...
thanks
 
It looks like the results are just a big string of values. You can use string functions and/or regular expressions to extract the different pieces of data and format them as needed.

But to parse data like this you first need to identify a patterns. For example, the literal header "Fruits" always appears before the individual fruit items, and the header is followed by a new line.

Once you identify the patterns you will be able to plug those into a string function or regular expression to extract the data you need.

Since the example is obviously just psuedo-data, that is about as specific as we can get in the advice department.


----------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top