I need to read the txt file, read_table. When reading a long sentence, everything works fine, except that it is greatly reduced and a three-spot appears at the remote part. it looks like this:
On Wednesday, March 7, the US reg ...
Is there any parameter in the read_table method that will make reading the file correct?
Here is the code:
import pandas as pd import numpy as np path=r"C:\Users\neir0\Downloads\Telegram Desktop\textout.txt" df=pd.read_table(path,header=None,encoding='utf-8') date=[] state=[] for index , row in df.iterrows(): x=8480 case_1=range(0,x,3) case_2=range(1,x,3) if "date :" in str(row) : date.append(row) elif 'content :' in str(row) : state.append(row) elif 'href :' in str(row): continue df=pd.DataFrame({'date':date,'content':state}) z=[] for p in df['date']: z.append(p) year=[] month=[] day=[] for w in z: w=str(w).split('T') t=str(w[0]).replace('-',' ').replace('date : ','').split(' ') year.append(t[4]) month.append(t[5]) day.append(t[6]) df=pd.DataFrame({'year':year,'month':month,'day':day,'content':state}) df.to_csv(r"C:\Users\neir0\Desktop\ez\bitcoin_analyzer\data\content.csv",index=False) I want to draw attention to the possible jamb - I convert the line of the file (Series) to the usual str (). I do this, to check the conditions