Wednesday, November 16, 2011

removing bad characters from file names

this will clean bad characters (such as \1b and \1f and \7f's) from a file and convert them to underscores

for file in *
do
mv “$file” $(echo “$file” | sed ‘s/[^A-Za-z0-9_.]/_/g’)
done

No comments:

Post a Comment