how to separate the strings in a string

2021-04-02 Thread Egon Frerich
I have a string like '"ab,c" , def' and need to separate it into "ab,c" and "def". split separates at the first ',': >>> bl '"a,bc", def' >>> bl.split(',') ['"a', 'bc"', ' def'] Egon signature.asc Description: OpenPGP digital signature -- https://mail.python.org/mailman/listinfo/python

Re: how to separate the strings in a string

2021-04-02 Thread Peter Otten
On 02/04/2021 11:16, Egon Frerich wrote: I have a string like '"ab,c" , def' and need to separate it into "ab,c" and "def". split separates at the first ',': bl '"a,bc", def' bl.split(',') ['"a', 'bc"', ' def'] The initial string looks like it's close enough to the CSV format. Unfortu

Re: how to separate the strings in a string

2021-04-02 Thread Peter Otten
On 02/04/2021 12:38, Peter Otten wrote: On 02/04/2021 11:16, Egon Frerich wrote: I have a string like '"ab,c" , def' and need to separate it into "ab,c" and "def". split separates at the first ',': bl '"a,bc", def' bl.split(',') ['"a', 'bc"', ' def'] The initial string looks like it'