File indexing completed on 2024-04-06 12:06:30
0001
0002 import argparse
0003 import pprint
0004 import json
0005 import os
0006 parser = argparse.ArgumentParser()
0007 parser.add_argument('version',action="store",help="Software version")
0008 results = parser.parse_args()
0009 FileName = '/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMScript/'+results.version+'/src/DPGAnalysis/HcalTools/scripts/rmt/mycurrentlist'
0010 FileNameSorted = '/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMScript/'+results.version+'/src/DPGAnalysis/HcalTools/scripts/rmt/currentlist'
0011 with open(FileName,'r') as first_file:
0012 rows = first_file.readlines()
0013 sorted_rows = sorted(rows, key=lambda x: int(x.split('LED_')[1]), reverse=True)
0014 with open(FileNameSorted,'w') as second_file:
0015 for row in sorted_rows:
0016 second_file.write(row)