Working with a text file that looks like this.
I am trying to append each line into an array and turning it to a clean dataframe. I used line.split() for lines being appended into the array but values in COL J would disappear for some rows when being appended into array because they are blank.
My code looks like this now.
import pandas as pd
my_array = []
with open('usesample01.txt') as my_file:
for line in my_file:
if 'RECORD' not in line and 'JOURNAL' not in line and 'VERSION' not in line and 'TIME' not in line and '-' not in line:
my_array.append(line.split())
df = pd.DataFrame(my_array, columns = ['A','B','C','D','E','F','G','H','I','J','K','L','M'])
print(df)