I'm sorry for "hijacking" a thread (I sincerely hope it won't be understood as hijacking, by no means I want to do any harm). Your solution didn't work for me (I use Linux and play EHM in Wine, although your bat scripts didn't work for me - maybe it was my mistake, I didn't really try and find out why).
Once again, I don't mean do to any harm, I'm just trying to help people who don't want to or can't use McQwak's solution for any reason. If anyone consider my post offensive, I'm willing to delete it.
Thus, I wrote my own solution, it's the following python script:
Code: Select all
def adjust_files(dir, years, should_print):
filename_re = re.compile("(.*_.*_(\d|\d\d)_(\d|\d\d)_)(\d\d\d\d).png")
for filename in os.listdir("."):
matches = filename_re.match(filename)
old_year = int(matches.group(4))
new_year = str(old_year + years)
new_name = matches.group(1) + new_year + ".png"
print("Renaming %s to %s" % (filename, new_name))
print(filename + " doesn't match.")
if __name__ == "__main__":
ap = argparse.ArgumentParser()
help="Directory with the face pack",
help="Print what is being done",
help="How many years should be added (works for negative)",
args = ap.parse_args()
adjust_files(args.directory, args.years, args.verbose)
IMPORTANT! Use only if you understand how to use it and use it at your own risk only! I tested it and it worked but I don't guarantee it will work for every case you might try, so always make a backup of your data.
Maybe I will try and make it more user friendly later but now I'm quite busy.