yes, it's fixed-width file.
If you want to read it with pandas - look at pandas.read_fwf
or just parse it your self (i.e. there is no much use of pandas if you just want to read it and then write to excel, without doing calcutions).
Also note that there is extra header line (the underlines of the header) which you will need to deal with in pandas.
If you want to read it with pandas - look at pandas.read_fwf
or just parse it your self (i.e. there is no much use of pandas if you just want to read it and then write to excel, without doing calcutions).
Also note that there is extra header line (the underlines of the header) which you will need to deal with in pandas.
import pandas as pd df = pd.read_fwf('mytxt.txt') df.drop(index=0, inplace=True) # drop the underlines print(df.head())
Output: Cutfile Name Start Time End Time Total Time Status ... Dry Run.1 Cut Speed Throughput Feed Rate Operator
1 BWW34580401 B 11/2/2020 6:39:37 AM 11/2/2020 6:40:05 AM 0:00:28 2 ... 0.000 0.000 0.000 0.000 Unknown
2 BWW34580401 B 11/2/2020 6:40:20 AM 11/2/2020 7:11:45 AM 0:31:25 3 ... 0.000 394.513 168.167 40.000 Unknown
3 PRECUT.$$$ 11/2/2020 7:21:07 AM 11/2/2020 7:21:22 AM 0:00:15 3 ... 0.000 354.574 173.032 40.000 Unknown
4 LFRF0106 30D A2 11/2/2020 7:32:59 AM 11/2/2020 8:00:49 AM 0:27:50 3 ... 0.000 430.553 200.613 40.000 Unknown
5 LFRF0106 30D A1 11/2/2020 8:19:21 AM 11/2/2020 9:08:27 AM 0:49:06 3 ... 0.000 430.338 200.812 40.000 Unknown
[5 rows x 27 columns]
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs