Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[SQL] quoted csv to array pattern

1 view
Skip to first unread message

Michael Moore

unread,
May 25, 2016, 7:27:42 PM5/25/16
to
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

David G. Johnston

unread,
May 25, 2016, 7:40:20 PM5/25/16
to
On Wed, May 25, 2016 at 7:25 PM, Michael Moore <michae...@gmail.com> wrote:
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


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.


 

Michael Moore

unread,
May 25, 2016, 8:26:25 PM5/25/16
to
Well, that explains why I couldn't find a solution. Thanks David
0 new messages