Re: Importing Lists with empty values

2008-06-10 Thread Les Mizzell
Raymond Camden wrote:
> Don't forget CF8 modified ListToArray so you can detect empty items in a list.


Yea - as soon as I get my freaking client to upgrade!!!
Still stuck with CF7!

~|
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:307217
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Importing Lists with empty values

2008-06-10 Thread Raymond Camden
Don't forget CF8 modified ListToArray so you can detect empty items in a list.

On Tue, Jun 10, 2008 at 5:19 PM, Brad Wood <[EMAIL PROTECTED]> wrote:
> 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.
>

~|
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:307216
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Importing Lists with empty values

2008-06-10 Thread Brad Wood
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:

--



   
   
   



  
  
  
  


. 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


Re: Importing Lists with empty values

2008-06-10 Thread Barney Boisvert
replace "|" with " | " (that's space-pipe-space), do your parse, and
then trim everything coming out of it.

cheers,
barneyb

On Tue, Jun 10, 2008 at 3:18 PM, Les Mizzell <[EMAIL PROTECTED]> wrote:
> 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:
>
> --
>
> 
>
>   
>   
>   
>
> 
> 
>  
>  
>  
>  
> 
>
>  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:307204
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4