Last active
March 2, 2020 07:30
-
-
Save ChaunceyHoover/1e5122abf784b8d4143b80c075e1c183 to your computer and use it in GitHub Desktop.
Run in Music folder - removes all special characters from file name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for d in ./*/ | |
do | |
cd $d | |
for file in ./* | |
do | |
infile=`echo "${file:2}"|sed \ | |
-e 's|"\"|"\\"|g' \ | |
-e 's| |\ |g' -e 's|!|\!|g' \ | |
-e 's|@|\@|g' -e 's|*|\*|g' \ | |
-e 's|&|\&|g' -e 's|]|\]|g' \ | |
-e 's|}|\}|g' -e 's|"|\"|g' \ | |
-e 's|,|\,|g' -e 's|?|\?|g' \ | |
-e 's|=|\=|g' ` | |
outfileNOSPECIALS=`echo "${file:2}"|sed -e 's|[^A-Za-z0-9.\ \(\)\-]||g'` | |
outfileNOoe=`echo $outfileNOSPECIALS| sed -e 's|ö|oe|g'` | |
outfileNOae=`echo $outfileNOoe| sed -e 's|ä|ae|g'` | |
outfileNOue=`echo $outfileNOae| sed -e 's|ü|ue|g'` | |
outfileNOOE=`echo $outfileNOue| sed -e 's|Ö|OE|g'` | |
outfileNOAE=`echo $outfileNOOE| sed -e 's|Ä|AE|g'` | |
outfileNOUE=`echo $outfileNOAE| sed -e 's|Ü|UE|g'` | |
outfileNOss=`echo $outfileNOUE| sed -e 's|ß|ss|g'` | |
outfileNOtag1=`echo $outfileNOss| sed -e 's|\ MP3 320||g'` | |
outfileNOtag2=`echo $outfileNOtag1| sed -e 's|\ MP3 192||g'` | |
outfileNOtag3=`echo $outfileNOtag2| sed -e 's|\ MP3 256||g'` | |
outfileNOtag4=`echo $outfileNOtag3| sed -e 's|\ MP3 V2||g'` | |
outfileNOtag5=`echo $outfileNOtag4| sed -e 's|\ MP3 V1||g'` | |
outfileNOtag6=`echo $outfileNOtag5| sed -e 's|\ MP3 V0||g'` | |
outfileNOtag7=`echo $outfileNOtag6| sed -e 's|\ MP3 V4||g'` | |
outfileNOtag8=`echo $outfileNOtag7| sed -e 's|\ MP3 160||g'` | |
outfileNOtag9=`echo $outfileNOtag8| sed -e 's|\ MP3 128||g'` | |
outfileNOtag10=`echo $outfileNOtag9| sed -e 's|\ MP3 96||g'` | |
outfile=${outfileNOtag10} | |
if [ "$infile" != "${outfile}" ] | |
then | |
echo "filename changed for " $infile " in " $outfile | |
mv "$infile" ${outfile} | |
fi | |
done | |
cd ~/Music | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment