python pandas read_fwf separate by \t

521 views Asked by At

I have tried these variations,

df = pd.read_fwf("test.txt", sep='\t', header = 20, engine='python')
df = pd.read_fwf("test.txt", sep=r'\\t', header = 20, engine='python')
df = pd.read_fwf("test.txt", sep='\\\\t', header = 20, engine='python')

print(list(df.columns.values))

The result I get is,

['Column1name\tColumn2name\tColumn3name\tColumn4name\tColumn5name']

0

There are 0 answers