Re: Loading an CSV

2009-12-22 Thread Barney Boisvert
Use a CSV parsing library, rather than rolling your own. They take care of all that stuff for you. I've used http://ostermiller.org/utils/CSV.html in the past. If you really want to parse it yourself, you can use listToArray, and then iterate over the array and combine items that are quoted.

Re: Loading an CSV

2009-12-22 Thread Claude Schneegans
Simply define an ODBC datasource using the Microsoft txt ODBC driver. Then requst the datasaource to get all records. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion

Re: Loading an CSV

2009-12-22 Thread Phillip Vector
Defining another datasource is not allowed in this. Yes, I know it's easier to do it that way, but unfortunally it's not an option here. On Tue, Dec 22, 2009 at 9:17 AM, Claude Schneegans schneeg...@internetique.com wrote: Simply define an ODBC datasource using the Microsoft txt ODBC driver.

Re: Loading an CSV

2009-12-22 Thread Phillip Vector
On Tue, Dec 22, 2009 at 9:09 AM, Barney Boisvert bboisv...@gmail.com wrote: Use a CSV parsing library, rather than rolling your own. They take care of all that stuff for you. I've used http://ostermiller.org/utils/CSV.html in the past. I took a look at that and didn't see anything that

Re: Loading an CSV

2009-12-22 Thread Leigh
Defining another datasource is not allowed in this. What database(s) are you using? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive:

Re: Loading an CSV

2009-12-22 Thread Phillip Vector
Oracle, but I do not have permission to set up another datasource. So I need to do it by coding. On Tue, Dec 22, 2009 at 9:24 AM, Leigh cfsearch...@yahoo.com wrote: Defining another datasource is not allowed in this. What database(s) are you using?

Re: Loading an CSV

2009-12-22 Thread Barney Boisvert
Quoting is part of standard CSV, Ostermiller will take care of it. But you don't need to loop over every character. Once you have your array, you start combining when you find an item that begins with a quote, and you stop combining when you find an item that ends with a quote. In my example,

Re: Loading an CSV

2009-12-22 Thread Phillip Vector
Ok.. I see what you are saying... Thanks. :) On Tue, Dec 22, 2009 at 9:26 AM, Barney Boisvert bboisv...@gmail.com wrote: Quoting is part of standard CSV, Ostermiller will take care of it. But you don't need to loop over every character.  Once you have your array, you start combining when you

Re: Loading an CSV

2009-12-22 Thread Leigh
Oracle Okay. I was thinking there might be options with an MS datasource. But as that is out of the question, I would go with Barney's suggestion. (Looks interesting. I will have to try it myself). ~| Want to reach

Re: Loading an CSV

2009-12-22 Thread Kevin Pepperman
I had a similar situation recently in an export from an old legacy application. (90% of my job) It may not apply to your situation, but it sure saves me a ton of time, so it is slightly relevant here. (Windows info only here) The data contained every single char (comma, semicolon, TAB, QUOTES[