I'd add CHR(13) to your list of delimiters, and use
<cfif not comparenocase(left(ltrim(line),3),"d:\")>
if you want to be real specific about it...

Isaac Dealey
Certified Advanced ColdFusion 5 Developer

www.turnkey.to
954-776-0046

> I created a text file that contained the following:

> c:\hsadfhosaf
> e:\jdosaijdfpjsa
> d:\djfphsapf
> f:\sdfoisuhdf
> c:\sdjfoisjfp
> d:\sdfoisf
> d:\shdfosha

> and when I rean the exact code I gave you with contains, I got three lines
> back.

> If you want to get lines that are exact matches to d:\, then make certain
> that your file contains some lines that contain ONLY d:\

> Because if I  run my code as EQ instead of CONTAINS., I get NO lines
> printed.

> This is the best I can do without seeing your exact txt file to know what
> you are starting with.


> ----- Original Message -----
> From: "FlashGuy" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Tuesday, September 03, 2002 9:31 AM
> Subject: Re: Checking variable within CFLOOP


>> Yea...I get the same results?
>>
>>
>> On Tue, 3 Sep 2002 09:20:05 -0500, Larry Juncker wrote:
>>
>> > Have you tried
>> >
>> > cfif Line CONTAINS "d:\">
>> > #Line#
>> > </cfif>
>> > </cfoutput>
>> >
>> >
>> > ----- Original Message -----
>> > From: "FlashGuy" <[EMAIL PROTECTED]>
>> > To: "CF-Talk" <[EMAIL PROTECTED]>
>> > Sent: Tuesday, September 03, 2002 9:11 AM
>> > Subject: Checking variable within CFLOOP
>> >
>> >
>> > > Hi,
>> > >
>> > > I'm reading in a file and need to check and output only the lines
>> > > that
>> > contain "d:\". The below code outputs *every* line in the file to the
>> > screen.
>> > > Whats wrong with the syntax below?
>> > >
>> > > <cfoutput>
>> > > <cfset strCR = Chr(10)>
>> > > <cffile action="read" file="C:\test.txt" variable="ListLoop">
>> > >
>> > > <cfloop list="#ListLoop#" Index="Line" Delimiters="#strCR#">
>> > >
>> > > <cfif Line EQ "d:\">
>> > > #Line#
>> > > </cfif>
>> > > </cfoutput>
>> > >
>> > >
>> > > ---------------------------------------------------
>> > > FIGJAM
>> > > ---------------------------------------------------
>> > >
>> > >
>> > >
>> > >
>> >
>>
> 
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to