Thread: quoted csv to array pattern
I am trying to use
SELECT regexp_split_to_table('''quick brown'', ''fox'' ''over, dog''', ',');
I need the output to be:
quick brown
fox
over, dog
Google was no help.
Thanks,
Mike
I am trying to useSELECT regexp_split_to_table('''quick brown'', ''fox'' ''over, dog''', ',');I need the output to be:quick brown
fox
over, dog
You cannot reliably/easily parse/split CSV with embedded delimiters using regex...you can cheat a bit if your data allows by making the delimiter <', '> instead of just <,>
David J.
Well, that explains why I couldn't find a solution. Thanks David
On Wed, May 25, 2016 at 4:34 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
I am trying to useSELECT regexp_split_to_table('''quick brown'', ''fox'' ''over, dog''', ',');I need the output to be:quick brown
fox
over, dogYou cannot reliably/easily parse/split CSV with embedded delimiters using regex...you can cheat a bit if your data allows by making the delimiter <', '> instead of just <,>David J.