Something like the following will build your comma-delimited list in CF:

<cflock timeout="5" name="readfile" type="READONLY">
        <cffile action="read" file="C:\file.txt" variable="ListLoop"> 
</cflock>       
        
<cfset myList = "">

<cfloop index="i" list="#listLoop#" delimiters="#chr(10)#">
        <cfif find("DATA",i) or find("FILE",i) or find("IMAGE",i)>
                <cfset myList = listAppend(myList,i)>
        </cfif>
</cfloop>


Now saving the text file to the user's machine is a different issue.
This isn't something you can accomplish in CF - you'll need to use some
client-side code (you'll have to get around the security issues, and if
you need it to be cross-browser compatible, you'll have a real challenge
on your hands).  

Keep in mind that it would be easier to store a cookie with the
information (though cookies have size limitations, and a cookie may not
fit your need)

**************************
Billy Cravens
Web and Software consulting
www.Architechx.com
 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:list-request@;dfwcfug.org] On
Behalf Of FlashGuy
Sent: Monday, October 28, 2002 1:10 PM
To: FlashMX
Subject: Reading from external file


Hi,

I require the following:

1. Read in an external file.
2. All lines that contains "DATA", "FILE", "IMAGE" are put into a
variable which is comma-delimited. Everything else that doesn't match
the criteria gets thrown out.
3. The results of this variable gets stored on the users PC for future
reference as a comma-deliimited text file (ref.txt)

<cflock timeout="5" name="readfile" type="READONLY">
        <cffile action="read" file="C:\file.txt" variable="ListLoop">
</cflock>

I'm not sure where to go next? I tried something like below but it lists
*everything* in the external file being read in.

<cfif ListLoop CONTAINS "DATA" OR
        ListLoop CONTAINS "DATA" OR
        ListLoop CONTAINS "DATA">
       #ListLoop#

</cfif>



---------------------------------------------------
Colonel Nathan R. Jessop
Commanding Officer
Marine Ground Forces
Guatanamo Bay, Cuba
---------------------------------------------------




------------------------------------------------------------------------
-
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info:
www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org



-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to