Insert additional characters into filenames to rename them.
First off, I apologize if this question has been asked before. I've searched but came up with no answers with the search words I used.
I have a folder with a large number of files. They are named with the following pattern:
5206.txt
5712.txt
6302.txt
7408.txt
... etc.,etc.,etc.
The first 2 digits are the year and the last 2 are the month. They are all relating to the 1900's.
I am wanting to change all the filenames via a script so they end up in this format.
1952-06.txt
1957-12.txt
1963-02.txt
1974-08.txt
... etc.,etc.,etc.
I don't seem to be good enough with bash, regex, sed, etc. to figure out how to do this. Any ideas?
|