Treat it as a list, but with line breaks or carriage returns as delimiter.
I'd convert the whole lot to an array, where each line was an element,
then loop over each element as a list - seems neatest way to do it in
this particular case.

<cfscript>
myStuff = "oneline,qwe
anotherline,wer
andanother,tee";

delim = chr(13)&chr(10);

aStuff = ListToArray(myStuff, delim);
for (i=1; i LTE ArrayLen(aStuff); i=i+1) {
for (j=1; j LTE ListLen(aStuff[i]); j=j+1) {
writeoutput(ListGetAt(aStuff[i], j) & '<br>');
}
writeoutput('<hr>');
}
</cfscript>

Cheers
Bert

----- Original Message -----
From: Mark Drew <[EMAIL PROTECTED]>
Date: Fri, 27 Aug 2004 15:59:42 +0200
Subject: Looping through lines in a file
To: CF-Talk <[EMAIL PROTECTED]>

How would I loop through each of the rows below in cfscript? I am
brain dead this afternoon

something, url
something else, else
somethingnice, nice

I want to loop through each row and then will split it as a list

any ideas?

--
Mark Drew
mailto:[EMAIL PROTECTED]
blog:http://cybersonic.blogspot.com/________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to