I am trying to replace a group of strings in a .csv file that have an extra "," comma and want to delete the extra comma. TabError: inconsistent use of tabs and spaces in indentation
import sys
import re
with open(sys.argv[1], "r", 500000000) as file_in:
contents = file_in.readlines()
with open("output.csv", "w") as file_out:
for line in contents:
line = re.sub(r"tx->{[0-9a-fA-F]{3},",tx->{[0-9a-fA-F]{3}, line)
My data looks like this:
mps,tx->{67f, 40 34 30 00 00 00 00 00} rx<-{5f3, 4b 34 30 00 88 00 00 00},<S t='n' c='GELE' s='7'/>{Hea
Would like my data to look like:
mps,tx->{67f 40 34 30 00 00 00 00 00} rx<-{5f3, 4b 34 30 00 88 00 00 00},<S t='n' c='GELE' s='7'/>{Hea