http://www.cflib.org/index.cfm?event=page.udfbyid&udfid=507 for starters
Alternatively you could do a manual replace to replace every instance of || with |some reserved word that you will interpret as blank| Just make sure you do the replace twice so "firstname|||address|other" will work as well. ~Brad -----Original Message----- From: Les Mizzell [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2008 5:18 PM To: CF-Talk Subject: Importing Lists with empty values I've set up a function for a client to import lists of email addresses from "|" delimeted files generated from Excel spreadsheets. There's a specific format that they always use: firstname|lastname|emailaddress|other No problems. The code below works fine: ---------------------------------------------- <cfloop from="1" to="#ArrayLen(queryFromFile)#" index="i"> <cfset fromARRAY = #queryFromFile[i]#> <cfset emailLIST = ""> <cfset emailLIST = ListAppend(emailLIST,fromARRAY,"|")> <!--- IF THE ROW DOES NOT HAVE ALL 4 ELEMENTS, SKIP IT ---> <cfif ListLen(emailLIST,"|") EQ 4> <cfset req.firstname = ListGetAt(emailLIST,1,"|")> <cfset req.lastname = ListGetAt(emailLIST,2,"|")> <cfset req.email = ListGetAt(emailLIST,3,"|")> <cfset req.other = ListGetAt(emailLIST,4,"|")> </cfif> ..... then check for valid email address and insert the row into the database... ---------------------------------------------- But, they need to import a bunch of new list that may *not* have all four fields for each row, so I could end up with a list looking like: firstname|lastname|emailaddress|other firstname||emailaddress|other |lastname|emailaddress|other Since the empty fields are ignored, everything gets snockered up into the wrong columns. What's going to be my best way to assign a null or empty value to the empty elements so everything ends up in the correct column? Been working on this for awhile, but haven't found a great solution yet ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307205 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4