Crap, I forgot to change the list position from 13 to 26. You'd need to do that if you decided to use this method. Good luck.
On Wed, Apr 22, 2009 at 3:04 PM, Michael Grant <[email protected]> wrote: > Ok, well this made me want to check it out so I did. I dumped one of my > database tables with 149,517 records into a flat text file that was tab > delimited. The total size was 20,546KB (20MB). > > Then I ran the code I provided to evaluate the 1st letter in the 19th > column (I don't have 26 in my table) and add to the array if it's "F" (It > just so happenned that it was a true/false field so that worked out. > > And the results are this: 12625 milliseconds to loop over all rows and > create the array (of 12,000 records which matched "f"). > I had task manager opened the whole time and the process added 0 (zero) to > the jrun cpu usage. I saw no substantial increase in memory usage either. > > So 12.6 seconds to loop over a 20MB text file certainly doesn't "choke a cf > server." I _highly_ doubt you could even set up the dsn in that amount of > time. > > On another note I noticed a typo in the code I pasted so I'll include new > code below. I also added a test to ensure the list item has the right amount > of columns so if you end up with a row with no data it doesn't crap out. You > could also just change this to a try/catch if you wanted to do extra work in > that instance. > > <cffile action="read" file="[your file path here]" variable="myTxt"> > <cfset myRecords = ArrayNew(1)> > <cfloop list="#myTxt#" index="x" delimiters="#CHR(13)#"> > <cfif ListLen(x,CHR(9)) GTE 13> > <cfif Left(Trim(ListGetAt(x,13,CHR(9))),1) EQ "F"> > <cfset temp = ArrayAppend(myRecords,x)> > </cfif> > </cfif> > </cfloop> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-community/message.cfm/messageid:295672 Subscription: http://www.houseoffusion.com/groups/cf-community/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5
