I have a folder containing .png
images that are named image1.png, image2.png, image3.png
etc.
The way this folder is organized, 3 consecutive images represent data from the same subject, so I'd like them to be named with the same identifying number + a letter to differentiate them. Like this:
image1.png --> 1-a.png
image2.png --> 1-b.png
image3.png --> 1-c.png
image4.png --> 2-a.png
image5.png --> 2-b.png
image6.png --> 2-c.png
and so on.
What would be the best way to do this? a Perl
script? or generating a .txt
in python
with the desired names and then using it to rename the files? I'm using Ubuntu
.
Thanks in advance!