Skip to main content
January 8, 2011
Answered

RegEx -Help.

  • January 8, 2011
  • 2 replies
  • 585 views

Hi;

I'm trying to figure out how to write a quick regex to find and replace [or ignore] commas in the vaules of a comma separated list:

i.e:

"ONE","TWO","THREE" ...etc...

May have a record that looks like

"ONE",,"THREE,"this is, four"

so I can't use ," or ", as the delimiter & a comma can show up in the data fields ...

any ideas?

-thanks

-sean

This topic has been closed for replies.
Correct answer JR__Bob__Dobbs

You might try looking at this function: http://www.cflib.org/udf/CSVtoArray from cflib.org.

2 replies

JR__Bob__DobbsCorrect answer
Inspiring
January 10, 2011

You might try looking at this function: http://www.cflib.org/udf/CSVtoArray from cflib.org.

January 10, 2011

hey thanks - I never thought to look, at least I can pick that apart and see how they are doing it....

-thanks

-sean

Inspiring
January 8, 2011

If this is coming from a .csv file, try reading it with cfhttp instead of cffile.  Then you will have a query object to work with.