I would like to separate a string that looks like this
'190-1\tbla-bla\tall_right\t"dont\tseparate me"\toooo').
The question how can I split it by tabs not concerning what is in quotations "". So the output is:
190-1, bla-bla, all_right, "dont\tseparate me", oooo
The answer was given by Scott Mermelstein:
line for line in csv.reader(infile):
Note the [] around the string in the answer on the other page.
EDIT
Answer was by @Scott Mermelstein
use the line for line in csv.reader(infile, delimiter='\t'): If this gets reopened, I'll convert this comment to an answer.
Note the [] around the string in the answer on the other page. If your line is only infile = '190-1\tbla-bla\tall_right\t"dont\tseparate me"\toooo', you'll get the result you describe. If your line is infile = ['190-1\tbla-bla\tall_right\t"dont\tseparate me"\toooo'] and you modify the reader line as above, you'll get the right result