#================================================ This script is a simple example of the Knowledge extraction tool ===============================================================#
workbook=xlrd.open_workbook(ExcelFileName)#Using xlrd library opens the Excel document with the input data
workbook=xlrd.open_workbook(os.path.join(os.path.dirname(os.path.realpath(__file__)),ExcelFileName))#Using xlrd library opens the Excel document with the input data
worksheets=workbook.sheet_names()
worksheet_OperationTime=worksheets[0]#It creates a variable that holds the first Excel worksheet
#==================================== Output preparation: output the updated values in the CMSD information model ====================================================#
ifnotcmsdFile:
datafile=CMSDFileName#It defines the name or the directory of the XML file that is manually written the CMSD information model
datafile=(os.path.join(os.path.dirname(os.path.realpath(__file__)),CMSDFileName))#It defines the name or the directory of the XML file that is manually written the CMSD information model
tree=et.parse(datafile)#This file will be parsed using the XML.ETREE Python library
procTime2.write('CMSD_TwoServers_Output.xml',encoding="utf8")#It writes the element tree to a specified file, using the 'utf8' output encoding
#================================= Output preparation: output the updated values in the JSON file of Topology10 =========================================================#
ifnotjsonFile:
jsonFile=open(JSONFileName,'r')#It opens the JSON file
jsonFile=open(os.path.join(os.path.dirname(os.path.realpath(__file__)),JSONFileName),'r')#It opens the JSON file