hi tap-out
you will have to use bash scripting to get to your goal.
it`s quite simple and learned in a few days. I have wrote a script some time ago, which is copying on file to multiple files, each having a running number (see code below) it is not renaming the first letters but the last, but it would be a similar script for your purpose.
Code:
#! /bin/bash
declare -i i
declare TARGET2
if [ "$1" == "-m" ] ; then
echo -n "source file path: "
read SOURCE
echo -n "target path with file name constants : "
read TARGET1
echo -n "start count number: "
read TARGETMIN
echo -n "end count number: "
read TARGETMAX
echo -n "target file ending (eg. .jpg): "
read TARGET3;
elif [ "$1" == "-c" ] ; then
SOURCE=$2
TARGET1=$3
TARGETMIN=$5
TARGETMAX=$6
TARGET3=$4;
elif [ -r "$1" ] ; then
echo "ja jetzt bist du in der if-Bedingung";
else
echo "-mcp: copies source file to multiple target files"
echo " mcp: usage: mcp [OPTION] SOURCE TARGET ENDING MINCOUNT MAXCOUNT"
echo " mcp: usage: SOURCE is the source file path"
echo " mcp: usage: TARGET target file path including file name prefix"
echo " mcp: usage: ENDING is the file name ending added to the copies"
echo " mcp: usage: MINCOUNT start count being added to file name"
echo " mcp: usage: MAXCOUNT is the end count number (zeros added accordingly)"
echo " mcp: option: -m menu guided input"
echo " mcp: option: -c (optional) command line input"
echo " mcp: option: -h this help text"
exit 1;
fi
while [ "1" -gt "0" ]; do
if [ "$TARGETMAX" -gt "9999" ] ; then
echo "ERROR: end count number should be less then 10000"
echo -n "end count number ( < 10'000): "
read TARGETMAX;
else break;
fi
if [ "$TARGETMIN" -gt "$TARGETMAX" ] ; then
echo "ERROR: start count number should be less than end count number";
echo -n "start count number:"
read TARGETMIN;
echo -n "end count number ( < 10'000): "
read TARGETMAX;
else break;
fi
done
i=$TARGETMIN
while [ "$i" -le "$TARGETMAX" ] ; do
if [ "$i" -lt "10" ] ; then
TARGET2="000"$i ;
elif [ "$i" -lt "100" ] ; then
TARGET2="00"$i ;
elif [ "$i" -lt "1000" ] ; then
TARGET2="0"$i ;
elif [ "$i" -lt "10000" ]; then
TARGET2=$i ;
fi
TARGET="$TARGET1$TARGET2$TARGET3"
cp $SOURCE $TARGET
if [ "$?" == "0" ] ; then
echo "$TARGET written";
fi
i=i+1;
done
to use this script, just copy it to a text editor, save it as mcp. Then open a terminal. go to the directory where mcp is. Write
to make it executable for the owner (g+x and o+x for group and others). Then
to get an explanation on how it works. Feel free to change them script for your needs.