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 off-the-shelf parser and just treat each individual
line as a separate CSV document (which they are), and then do your
aggregation between them however you see fit.

At the very least, build yourself a UDF that strictly does CSV parsing
so you don't have that logic mixed in with your business logic,
because it's more complicated than you think.  And if you go this
route, ensure you consider the differences between "standard" and
Excel CSV format.

cheers,
barneyb

On Thu, Jun 3, 2010 at 10:32 AM,  <p...@smashedvision.com> wrote:
>
> 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
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334272
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to