import csv txt = """ix\ttext\ta\tb\tc 1\tHumpty Dumpty sat on a wall,\t1\t2\t3 2\tHumpty Dumpty had a great fall.\t1\t2\t3 3\tAll the king's horses and all the king's men\t1\t2\t3 4\tCouldn't put "Humpty" together again.\t1\t2\t3""" print(repr(csv.Sniffer().sniff(txt).delimiter))