I have a simple script that allows me to rename files from a CSV.
Column 1 files to renamed into column 2.
It was working a few months ago on 10.11.
I'm running 10.12.1 at the moment. Mentioning this as I can't think of any other changes.
Notes: all image files in /rename
csv file is also in /rename
image 1. flow
image 2. error
Script that I frankensteined together from searching various threads;
cd "$1"
while read line
do
OldImageName=${line%,*}
NewImageName=${line#*,}
NewImageName=$( echo "$NewImageName" | tr -d '\r' )
if [ -e "$OldImageName" ] ; then
mv "$OldImageName" "$NewImageName"
else
echo "$OldImageName" >> ~/Desktop/Errors.txt
fi
done <"$2"error
Thank you
Column 1 files to renamed into column 2.
It was working a few months ago on 10.11.
I'm running 10.12.1 at the moment. Mentioning this as I can't think of any other changes.
Notes: all image files in /rename
csv file is also in /rename
image 1. flow
image 2. error
Script that I frankensteined together from searching various threads;
cd "$1"
while read line
do
OldImageName=${line%,*}
NewImageName=${line#*,}
NewImageName=$( echo "$NewImageName" | tr -d '\r' )
if [ -e "$OldImageName" ] ; then
mv "$OldImageName" "$NewImageName"
else
echo "$OldImageName" >> ~/Desktop/Errors.txt
fi
done <"$2"error
Thank you