||
import os
import linecache
import pandas as pd
lne=[]
fne=[]
for root ,dirs,files in os.walk(os.getcwd()):
for file in files:
filename=os.path.join(root,file)
if filename.endswith("summary"):
fne.append(file)
line=linecache.getline(filename,24)
lne.append(line)
count=pd.DataFrame({"count rms value ":lne,"filename":fne})
count.to_csv("count.txt",index=None,encoding="utf-8")
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-24 06:21
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社