The CSV format is not a comma-delimited list per line.  It's richer
than that.  So you can't just use the list functions on it, you need
an actual CSV parser.  One isn't hard to write (and there are several
valid approaches), but the easiest course of action is to just grab
one that is already written.  I've used
http://ostermiller.org/utils/CSV.html on a few occasions with great
success.  It's Java and token-based, but it's simple enough.

cheers,
barneyb

On Mon, Mar 15, 2010 at 11:31 AM, Les Irvin <[email protected]> wrote:
>
> Hi all -
>
> I'm trying to (unsuccessfully) import a comma delimited text file
> (from an MLS service) into a MySQL db and looping over the file using
> listgetat in this manner:
>
> ...
> '#listgetAt('#index#',4, ',')#',
> '#listgetAt('#index#',5, ',')#',
> '#listgetAt('#index#',6, ',')#'
> ...
>
> I'm suspecting that the format of the text file is breaking my code.
> Here's a sample of the text file.
>
> "RES","A","AUN",776082,877,"","ST","RACINE","HOFFMAN
> TOWN",80011,3,2,"RES","1051","","","KELLER WILLIAMS REALTY
> LLC","CHARMING RANCH STYLE HOME, 3 BEDROOMS, 2 FULL BATHS, CONCRETE
> EXTENDED DRIVEWAY (ISSUES), NO FHA !!",5,"",,"","AURO",1681,
>
> Note that text items have quotes around them and number items don't.
> Also, text items can and do include commas within.  Am I improperly
> using the listgetat function?  If so, how can I rewrite it to get
> around these issues?
>
> Many thanks in advance,
> Les
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331765
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to