diff options
-rwxr-xr-x | utils/zdab-reprocess | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/utils/zdab-reprocess b/utils/zdab-reprocess index 53c7a0d..172e110 100755 --- a/utils/zdab-reprocess +++ b/utils/zdab-reprocess @@ -352,7 +352,8 @@ if __name__ == '__main__': parser.add_argument("--suffix", default="reprocessed", help="suffix appended to output filename") args = parser.parse_args() - filename_re = "SNOCR_(\d+)_\d+_p\d+.xzdab" + filename_re = "(SNOCR_|SNO)(\d+)_(\w+).(x?zdab)" + p = re.compile(filename_re) template = MyTemplate(SNOMAN_TEMPLATE) @@ -365,15 +366,17 @@ if __name__ == '__main__': print("Unable to parse filename '%s'" % tail) sys.exit(1) + prefix, run, tail, ext = match.groups() + try: - run = int(match.group(1)) + run = int(run) except Exception as e: print("Unable to convert run number to int: %s" % str(e)) sys.exit(1) root, ext = splitext(tail) - output = "%s_%s.xzdab" % (root,args.suffix) + output = "%s_%s.%s" % (root,args.suffix,ext) if args.dir: output = os.path.join(args.dir,output) |