Is there a way to speedup this code regex code? The file is really large and will not open in excel because of size.
import regex as re
path = "C:/Users/.../CDPH/"
with open(path + 'Thefile.tab') as file:
data = file.read()
# replace all space bars between tab characters
data = re.sub('( )*(?=\n)|( )*(?=\t)', '', data )
with open(path + 'Data.csv', 'w') as file:
file.write(data)