Re: Handling In-Field Commas in CSV import?

2010-06-04 Thread denstar
On Thu, Jun 3, 2010 at 2:35 PM, Paul Henderson wrote: This solution worked for me: http://www.bennadel.com/blog/1903-Parsing-CSV-Data-With-ColdFusion-s-CFHTTP-Tag.htm I've done that in the past with some success. It all depends on how good the data is. GIGO, ja know? There's a long,

Handling In-Field Commas in CSV import?

2010-06-03 Thread paul
I'm trying to import a comma delimited CSV file using cfloop file=filename.csv, but some records contain commas and they are throwing everything off. I can't seem to figure out how to replace the in-field commas without messing up the delimiter. Any ideas? Thanks in advance. -Paul

Re: Handling In-Field Commas in CSV import?

2010-06-03 Thread Barney Boisvert
There is absolutely no reason to parse a CSV document manually; there are myriad tools for exactly this purpose. A quick Googling will turn up a pile of options. You may need to tweak them if your file is enormous and must be processed line-by-line, but even then you should be able to use an

Re: Handling In-Field Commas in CSV import?

2010-06-03 Thread Judah McAuley
Any delimited file that has delimiters contained within a field is supposed to use a text qualifier. For CSV, the most common qualifier is double quotes, so your file would look like: 1234,field 1,my big field, that has a delimiter or two, but is qualified If there are not text qualifiers and a

Re: Handling In-Field Commas in CSV import?

2010-06-03 Thread Paul Henderson
Thanks for the replies, it seems like I'm taking the wrong approach. Currently I am using a cfloop to loop over the file, then #listgetat(FileLine,1)# to reference each field. cfloop file=C:\CSVs\2010-05-21.csv index=FileLine cfset record_type = '#listgetat(FileLine,1)#' /cfloop It

Re: Handling In-Field Commas in CSV import?

2010-06-03 Thread Paul Henderson
This solution worked for me: http://www.bennadel.com/blog/1903-Parsing-CSV-Data-With-ColdFusion-s-CFHTTP-Tag.htm On Thu, 03 Jun 2010 14:27:08 -0400, Paul Henderson p...@smashedvision.com wrote: Thanks for the replies, it seems like I'm taking the wrong approach. Currently I am using