I have almost 500 directories full of files with names like
e141107140847.pdf, and I need to rename them to something user-friendly like
2014_11_SDUXS_0847.pdf. I've been trying to use a for loop and sed, but I'm in over my head and can't figure out how to put everything together. I also don't have access to the
rename command on this machine (FreeBSD).
The mapping is as follows:
e— garbage character, to be removed
14— translates to
SDUXS. I have 36 different mappings to handle.
07— day, to be removed
14— year, to be converted to 4 digits
0847— location code, kept.