I read text file with header=None because first 6 lines are unnecessary and becoming obstacle in using '|' as delimiter. Because I need to convert text file in csv file.
Then I need to convert that file into csv file and I again need to import 27evening.csv file by using delimiter '|'. Then only I can save df2 as final csv.
I don not want to save(as csv) after 4th step shown in figure and want to open userhistory_aam.txt by using delimiter "|". Here I don't want to generate unnecessary middle file(27evening.csv) Can you please provide alternative.
'''
import pandas as pd
import numpy as np
df = pd.read_csv("userhistory_aam[50][100]27May.txt", header = None)
df.columns = [''] * len(df.columns)
df.drop([0,1,2,3,4,6],0,inplace=True)
df.to_csv("27evening.csv", index = None)
df2 = pd.read_csv("27evening.csv", delimiter = '|')
df2.to_csv('final.csv')
'''