Mihir Kothari
2019-09-24 19:55:25 UTC
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.
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.