CodePudding user response:
import pandas as pd
F1=open (' test1. TXT ', 'r')
The texts=f1. Readlines ()
data=https://bbs.csdn.net/topics/pd.DataFrame ()
For the text in texts:
Ss=text. The split (" + ")
Tempdict={}
Tempdict [' date ']=ss [0]
Tempdict [' member name ']=ss [1]
Tempdict [' name ']=ss [2]
Tempdict [' id ']=ss [3]
Tempdict [' amount ']="". Join (ss [4]. The split ())
Print (tempdict)
data=https://bbs.csdn.net/topics/data.append (tempdict, ignore_index=True)
Data. To_excel (test1. XLSX, index=False)
The inside of the best is to put the data in the form of a generation of friends
CodePudding user response:
First snow05.22 + + zhang SAN + 824951512 + 58.5
05.21 + spring tides occur, li si + 751524641 + 65.2
CodePudding user response:
sstotal=[]
For the text in texts:
Ss=[" "join (x.s plit ()) for x in the text. The split (" +") "
Sstotal. Append (ss)
data=https://bbs.csdn.net/topics/pd.DataFrame (sstotal, columns=[' date ', 'member name', 'name', 'number', 'amount'])
Data. To_excel (" test2. XLSX, "index=False)
CodePudding user response:
Python can readCodePudding user response:
Newborn