easiest way to remove backslash from many filenames

contoursvt

macrumors 6502a
Original poster
Jul 22, 2005
832
0
I've got a client who's got thousands and thousands of files which are in subfolders that contain backslashes. He wants to either replace the slashes with another character or just remove them.

Can automator deal with multiple folders that contain folders in them ..etc..maybe 3-4 nests deep? If not, then maybe a free download that can do this?

Any suggestions welcome.
 

GGJstudios

macrumors Westmere
May 16, 2008
44,427
786
Name Mangler

Just do a search of the parent folder for all files. Then sort by kind and select the files (not folders) you want to change. Simple!
 

Caleb531

macrumors 6502
Oct 17, 2009
289
0
Best way to do this is with a free utility called NameChanger. Just get a list of the files in one place (best way is to search for them), and drag them into NameChanger. Then you can set NameChanger to replace certain characters in the filenames.
 

Attachments

bredell

macrumors regular
Mar 30, 2008
127
1
Uppsala, Sweden
Here's one for the terminal. Open the Terminal application and go to the top directory where you want to rename the files.

To rename directories:

IFS=$'\n' find . -type d -name '*\\*' | while read -r NAME; do NEW=$(tr '\\' ' ' <<< "$NAME"); mv "$NAME" "$NEW"; done

To rename files:

IFS=$'\n' find . -type f -name '*\\*' | while read -r NAME; do NEW=$(tr '\\' ' ' <<< "$NAME"); mv "$NAME" "$NEW"; done

These commands replace the backslash with a normal space. As usual when using the terminal you should try it on some test files first.
 

FourCandles

macrumors 6502a
Feb 10, 2009
835
0
England
NameMangler (or Fie List if you're still on Tiger or before; same developer) can deal with multiple nested folders and will do a find and replace on the backslash character just in the file names, all in one drag-and-drop.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.