>I'm trying to see how to read a text file where each >field is delimited
bycomma and each record is >delimited by linebreak. The cffile tag reads
the >whole file into a single variable..then how do I >break it up into
records, then into separate >fields?
A couple of things, you chould read the whole thing into memory and have a
list of lists
<cffile action=read variable="MyRSet">
<cfset newline = Chr(13) & Chr(10) >
<cfloop list="MyRSet" delimiters="#newline#" index= "CurrentLine">
<cfloop list="CurrentLine" delimiters="," index="column">
#column#
</cfloop>
<br>
</cfloop>
but that mean that the whole file is read into memory .Have a look at
cfx_readline @ www.Intrafoundation.com , it might be handy.
There are other ways , depends on a whole load of things ...
~Justin
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
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.