Use the one I did...it isn't tied to the 3rd position and spits out the
emails as needed.
<cffile action="read" file="#ExpandPath('.')#/test.txt" variable="fileData">
<cfset fileData = Replace(fileData, chr(13), "|", "ALL")>
<cfset fileData = Replace(fileData, chr(9), "|" , "ALL")>
<cfloop index="i" list="#fileData#" delimiters="#chr(10)##chr(13)#">
<cfset emailPosition = ListContains(i, "@", "|")>
<cfif emailPosition GT 0>
<cfoutput><li>#ListGetAt(i, emailPosition, "|")#</li></cfoutput>
</cfif>
</cfloop>
To tweak it for names just do something like this:
<cffile action="read" file="#ExpandPath('.')#/test.txt" variable="fileData">
<cfset fileData = Replace(fileData, chr(13), "|", "ALL")>
<cfset fileData = Replace(fileData, chr(9), "|" , "ALL")>
<cfloop index="i" list="#fileData#" delimiters="#chr(10)##chr(13)#">
<cfset emailPosition = ListContains(i, "@", "|")>
<cfif emailPosition GT 0>
<cfset record = ListGetAt(i, emailPosition, "|")>
</cfif>
<cfset record = ListGetAt(i, 1, "|") & " " & ListGetAt(i, 2, "|") & "'s
email address is " & record>
<li><cfoutput>#record#</cfoutput></li>
</cfloop>
If 1 and 2 are always first and last name you can pull them individually. I
typed the above here in Google so you might have some errors.
On 2/10/06, dave <[EMAIL PROTECTED]> wrote:
>
> ok it still doesnt work right.
> If i go to output it into db I get errors that the 3 position is empty and
> I still get records back like
> ,Sanyer,[EMAIL PROTECTED]
> John F,Kelly, Jr,[EMAIL PROTECTED]
> which of course makes it error
>
> ~Dave the disruptor~
> I forgot what I was gunna put here, Will woulda stole it anyways!
>
> ----------------------------------------
> From: James Holmes <[EMAIL PROTECTED]>
> Sent: Friday, February 10, 2006 4:17 AM
> To: CF-Talk <[email protected]>
> Subject: Re: parsing a list
>
> ROFL!
>
> 1) Download it
> 2) Join the CFAJAX mailing list
> 3) Ask questions there... ;-)
>
> On 2/10/06, dave wrote:
>
> >
> > ok now teach me cfajax real quick like!! ;)
>
> --
> CFAJAX docs and other useful articles:
> http://jr-holmes.coldfusionjournal.com/
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232001
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54