f1.seek(0)
print(dialect.delimiter)
rows = csv.reader(f1, delimiter=dialect.delimiter)
writer = csv.writer(f2, delimiter=';')
writer.writerows(rows)
Find delimiter in txt to convert to csv using Python