Thanks for the suggestions! Rick
> -----Original Message----- > From: Barney Boisvert [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 18, 2008 5:04 PM > To: CF-Talk > Subject: Re: How to parse a text file... > > Best bet would be to do listToArray() with newline as the delimiter, > and then loop over the array and split each item on a tab. > > Though if you've already got LOAD DATA INFILE set up, why not just set > up some REReplaces to sanitize the input file before import. Do > things like replace sequential newlines with a single newline and > such. > > cheers, > barneyb > > On Thu, Sep 18, 2008 at 2:00 PM, Rick Faircloth > <[EMAIL PROTECTED]> wrote: > > Hi, all... > > > > I've got a text file that I'm trying to read with cffile that has > > data structured like this: > > > > 96201_01.jpg Main View > > 96202_01.jpg Alternate View 01 > > etc... > > > > This is a list of photos with a description of each photo. > > There is a tab between the photo filename and the description, > > then a return...chr(10)&chr(13)...at the end of each pair. > > > > I've tried several methods to get this code into an array with > > the filename as the first array element and the description as the > > second array element, but so far it's not working. > > > > I read the file with this code: > > > > <cffile action = "read" > > file = "e:\active_photos.txt" > > variable = "active_photos" /> > > > > From here, I've tried listtoarray, etc., but I can't get the > > info in the text file into an array properly. > > > > I can use listtoarray with chr(10)&chr(13) as the delimiters, > > but that gives me each row as an element. > > > > I can't figure out how to use both delimiters to parse the rows and the row > > elements. > > > > I was using the MySQL function, "load data infile," to load the data into a > > table, > > but some of the text files have blank lines, like the <enter> key was > > struck a couple > > of times, and that throws an error with load data infile. > > > > Suggestions? > > > > Thanks, > > > > Rick > > > -- > Barney Boisvert > [EMAIL PROTECTED] > http://www.barneyb.com/ > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312793 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

