Python - how to read/parse csv like line?
use the csv module, it does what you need.
yourstring= '"ABC", "XYZ,MNO", "KLM"\n"ABC", "MN"\n"ABC", "123", "10", "OPPA GANGNAM STYLE", "LADY"'
import csv
import io
class MyDialect(csv.Dialect):
strict = True
skipinitialspace = True
quoting = csv.QUOTE_ALL
delimiter = ','
quotechar = '"'
lineterminator = '\n'
b = io.StringIO(yourstring)
r = csv.reader(b, MyDialect())
for i in r:
print len(i), ':',' @ '.join(i)