GEZA
2018-12-04, 04:24 PM
I use this scripts to combined OSS stats from multiple Huawei PRS.
Hope it helps.
written in python 3
import pandas as pdimport os
import datetime
rootDir = os.getcwd()
filelist = []
excellist = []
today = datetime.date.today()
delta = datetime.timedelta(days=-1)
yesterday = today + delta
startDate = yesterday.strftime('%Y%m%d')
#get all xlsx files
for filename in os.listdir(rootDir):
if os.path.splitext(filename)[1] == '.xlsx':
filelist.append(filename)
#file name of combined file
filename_combined = startDate + 'Huawei All.xlsx'
writer = pd.ExcelWriter(filename_combined)
#read info to list
for excelfile in filelist:
excellist.append(pd.read_excel(excelfile))
#write combined info to excel file
newdf = pd.concat(excellist,sort=False)
newdf.to_excel(writer,index=False)
#save excel file
writer.save()
Hope it helps.
written in python 3
import pandas as pdimport os
import datetime
rootDir = os.getcwd()
filelist = []
excellist = []
today = datetime.date.today()
delta = datetime.timedelta(days=-1)
yesterday = today + delta
startDate = yesterday.strftime('%Y%m%d')
#get all xlsx files
for filename in os.listdir(rootDir):
if os.path.splitext(filename)[1] == '.xlsx':
filelist.append(filename)
#file name of combined file
filename_combined = startDate + 'Huawei All.xlsx'
writer = pd.ExcelWriter(filename_combined)
#read info to list
for excelfile in filelist:
excellist.append(pd.read_excel(excelfile))
#write combined info to excel file
newdf = pd.concat(excellist,sort=False)
newdf.to_excel(writer,index=False)
#save excel file
writer.save()