I figured it out....
thanks,
Brian
<cffile action="READ" file="/var/www/html/af/testfile.txt" variable="txt">
<cfset rowcount = 0>
<cfloop list="#txt#" delimiters="#chr(10)#" index="i">
<cfset rowcount = rowcount +1 >
<cfif i contains "To: [EMAIL PROTECTED]">
==========<br>
<cfset rowcount = 1>
</cfif>
<cfif rowcount GT 7 AND rowcount LT 24>
<cfquery INSERT statement goes here>
<cfoutput>#i#<br></cfoutput>
</cfif>
</cfloop>
I need a couple of pointers on text file processing.
First I use <cffile> to get the file into a memory variable
Now I need to:
- parse the file one line at a time searching for a specific string and when I find it
- read 7 more lines and then begin reading the next 15 lines, one line at a time,
writing the contents to a database.
- after 15 of these lines I repeat the search for the next record set.
- reach EndOfFile and terminate
thanks,
Brian
______________________________________________________________________
Dedicated Windows 2000 Server
PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
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