text = "";
crlf = chr(13) & chr(10);
delim = "[EMAIL PROTECTED]";
start = 1;
cont = true;
fOutput = Replace(fOutput,crlf,chr(10),"ALL");
while(cont){
end = Find(delim,fOutput,start);
if(NOT end){
end = Len(fOutput);
cont = false;
}
line = Mid(fOutput,start,end-start);
start = end + Len(delim);
if(Len(Trim(line))){
text = text & REReplace(line,"[#chr(9)# ]*#chr(10)#",",","ALL") & crlf;
}
}
</cfscript>
<cffile action=""
file="employerNew.txt"
output="#text#"
addnewline="No">
Depending on what you want to do, you may need to get rid of some leading and/or trailing commas in the lines.
Btw, in cf a list delimiter is only one character. So if you set delimiters="[EMAIL PROTECTED]", you will have a new element when ~ , @ OR � is found.
Pascal
> -----Original Message-----
> From: cf coder [mailto:[EMAIL PROTECTED]
> Sent: vrijdag 2 april 2004 16:35
> To: CF-Talk
> Subject: how to get rid of the new line character
>
> hi guys I'm hoping someone can help me. I'm reading a text
> file <cffile
> action=""> > file="employer.txt"
> variable="fOutput">
>
> Looping through the text file, I've set the list delimter to
> be "[EMAIL PROTECTED]".
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

