Let's say I have a bunch of .jpg files which I want to convert to .png.  The file structure is as follow:00-01.jpg 00-02.jpg 00-03.jpg 00-04.jpg 00-05a.jpg00-05b.jpg01-01.jpg 01-02.jpg 01-03a.jpg01-03b.jpg01-04a.jpg01-04b.jpgSo now I want to rename  00-01.jpg to ACDfff001.png  then 00-02.jpg to ACDfff002.png and so on.  However when I reach 00-05a.jpg and 00-05b.jpg  I want to name these as ACDfff005a.png respectively ACDfff005b.png. The final result e.g should be as:00-01.jpg  ->  ACDfff001.png00-02.jpg  ->  ACDfff002.png00-03.jpg  ->  ACDfff003.png00-04.jpg  ->  ACDfff004.png00-05a.jpg ->  ACDfff005a.png00-05b.jpg ->  ACDfff005b.png01-01.jpg  ->  ACDfff006.png01-02.jpg  ->  ACDfff007.png01-03a.jpg ->  ACDfff008a.png01-03b.jpg ->  ACDfff008b.png01-04a.jpg ->  ACDfff009a.png01-04b.jpg ->  ACDfff009b.pngIs this possible in bash or python?
How to rename bulk of jpg files to png using convert
bash;python;rename
Here's a starting point; it assumes that the indexes only go up to 9; you'll have to extend it if that's not true.#!/bin/bashindex=0lastseq=for file in *.jpgdo  base=$(basename $file .jpg)  lastchar=${base: -1:1}  if [[ $lastchar =~ [[:digit:]] ]]  then    index=$((index + 1))    newname=$(printf ACDfff%03d $index)    lastseq=$lastchar  else    seclast=${base: -2:1}    if [[ $seclast != $lastseq ]]    then      index=$((index + 1))      lastseq=$seclast    fi    newname=$(printf ACDfff%03d%s $index $lastchar)  fi  echo mv $file ${newname}.pngdone