Forked from
jlab / hallc / exp / polhe3 / hallc_replay
793 commits behind the upstream repository.
-
Eric Pooser authored
* Include trigger apparatus to scaler replay * Add rate, live time, and dead time to scalers template * Add rate, live time, and dead time to all template * Rename ALL to PROD for production * Move test stand DEF-files into TEST_STAND directory
Eric Pooser authored* Include trigger apparatus to scaler replay * Add rate, live time, and dead time to scalers template * Add rate, live time, and dead time to all template * Rename ALL to PROD for production * Move test stand DEF-files into TEST_STAND directory
merge_def_files.py 671 B
#!/usr/bin/python
# Python script to merge multiple def-files into single def-file
import os
import sys
if (len(sys.argv) != 3 or sys.argv[1] == '-h'):
print('Usage:')
print(' merge_def_files.py merge_list.txt outfile.def')
sys.exit()
defFileList = open(sys.argv[1], 'r')
defFile = defFileList.readlines()
defFilePath = []
mergedDefFile = sys.argv[2]
for defFileName in defFile:
defFilePath.append((defFileName).strip())
with open(mergedDefFile, 'w') as outFile:
for defFileName in defFilePath:
outFile.write('\n\n')
with open(defFileName) as inFile:
for line in inFile:
outFile.write(line)