That will make CF parse the list twice.  You definitly don't want to do
that if the file is large.  
Try this:
<cfset i = 1>
<cfloop list="#MyFileContent#" index="Line" delimiters="#chr(10)#">
     <cfif i MOD 2>
          <cfset Email = Right(Line, Len(Line) - Find(":",line))>
     <cfelse>
          <cfset Name = Right(Line, Len(Line) - Find(":",line))>
     </cfif>
     <cfset i = i + 1>
</cfloop>

I haven't tested the code, but you get the idea.

Hope that helps,
Chris
----------------------------------------------
Original Message
From: "Bud"<[EMAIL PROTECTED]>
Subject: Re: <CF_STUMPED> LOOP'ing challenge
Date: Tue, 23 May 2000 16:36:49 -0400

>On 5/23/00, [EMAIL PROTECTED] penned:
>>I'm stuck on something that might be really simple to someone.
>>
>>I have these large flat files that are carriage return delimited that
>>contain the same data over and over again.  I'm trying to parse out
>>this data for display and later for database insertion.
>>
>>I've figured out how to pull out the email address information but
>>I need to pullI out the name information too.  Here's what I have so
>>far and the format of the flat file.
>>
>>***BEGIN**FLAT**FILE******
>>Email: [EMAIL PROTECTED]
>>Name: firstname lastname
>>Email: [EMAIL PROTECTED]
>>Name: firstname lastname
>>Email: [EMAIL PROTECTED]
>>Name: firstname lastname
>
>Since the first word of each 2 record recordset you're trying to 
>capture is Email, why don't you do it like this:
>
><CFFILE (blah blah)
>VARIABLE="text">
>
><cfset delim = chr(13) & "Email">
>
><cfset text = replace(text, delim, "|Email", "ALL")>
>
>That should effectively make the text variable look like this:
>
>Email: [EMAIL PROTECTED]
>Name: firstname lastname|Email: [EMAIL PROTECTED]
>Name: firstname lastname|Email: [EMAIL PROTECTED]
>Name: firstname lastname
>
>Than you can do a loop on the pipe delimiter and nest a loop inside 
>on the chr(13) delimiter . That should give you a good start.
>
>
>Bud Schneehagen - Tropical Web Creations
>
>_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>ColdFusion Solutions / eCommerce Development
>[EMAIL PROTECTED]
>http://www.twcreations.com/
>954.721.3452
>---------------------------------------------------------------------------
---
>Archives: http://www.eGroups.com/list/cf-talk
>To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

_____________________________________________
Free email with personality! Over 200 domains!
http://www.MyOwnEmail.com

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to