Hello,

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

***END****

******EXISTIN***CODE******
<CFSET text=ArrayNew(1)>

<!--- READ FILE FROM FILE SYSTEM --->
<CFFILE ACTION="Read"
           FILE="Drive:\testfiles\020300.txt"
         VARIABLE="text">
<!--- BEGIN LOOPING THROUGH LIST PROCESS --->
<CFLOOP INDEX="fred" LIST="#ReplaceList(text, """", "")#" 
DELIMITERS="#Chr(13)#">

<!--- AFTER TRIMMING FRED IF THE VALUE IS NOT EMPTY --->
<!--- A, If the entire set of information is empty, don't include --->
         <!--- EMAIL --->
         <!--- B, If each record contains the text E-Mail: include --->
         <CFIF #Trim(FRED)# contains "E-mail:">
         <CFSET newFRED = #removechars(FRED, 1, 9)#>
                 <!--- C, If after stripping everything away except the 
email line, make sure there's a value--->
                 <CFIF #Trim(newFRED)# IS NOT "">
                                 <!--- D, After there's a value and it's 
not empty, make sure there's an @ sign --->
                         <CFIF #Trim(newFRED)# contains "@">
                         <CFSET newFRED2 = #newFRED#>


                                 <cfoutput>#Trim(newFRED2)#</cfoutput> - <br>
                 </cfif>
         </cfif>
</cfif>
</CFLOOP>
Done
***END****


D-


------------------------------------------------------------------------------
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