CSV reader ignore brackets

Mihir Kothari mihir.kothari at gmail.com
Tue Sep 24 15:55:25 EDT 2019


Hi Team,

I am using python 3.4. I have a CSV file as below:

ABC,PQR,(TEST1,TEST2)
FQW,RTE,MDE

Basically comma-separated rows, where some rows have a data in column which
is array like i.e. in brackets.
So I need to read the file and treat such columns as one i.e. do not
separate based on comma if it is inside the bracket.

In short I need to read a CSV file where separator inside the brackets
needs to be ignored.

Output:
Column:   1       2                3
Row1:    ABC  PQR  (TEST1,TEST2)
Row2:    FQW  RTE  MDE

Can you please help with the snippet?

Regards,
Mihir.



More information about the Python-list mailing list