Finding and replacing a single character in 450k files.

newspapermike

Registered
Hi all,

I am the Manager of IT for a small Alberta, Canada newspaper. I recently purchased an Infrant ReadyNAS box to serve as our primary file server. Upon transferring over our Mac files I found that the protocol on the NAS didn't like '/' or '\' in filenames. I attempted to use the find utility to search for that character but it couldn't find any (though I know several hundred are there). Does Mac have the capability to use wildcards? (i.e. */*.*)

If anyone could tell me the easiest way to search for this character - and ideally remove them - from my filenames it would be greatly appreciated as currently it is involving me manually browsing through several thousand folders.

Mike
 
Do you have php running on the machine? If so I have a php script which will do it. I'm sure that others here can contribute a shell script if needed.
 
Sounds like your mac operators need to update their file naming protocols! Those characters are a definite no no...
 
I find your question odd (pun intended!) Why do you not use the find -command?

On terminal, type

$ find . -name '*\\*'

and you should get list of files that have \ character on their name.
 
There are quite a few GUI tools for this. I have recently examined a couple.
Cost money= NameCleaner, A Better Finder Rename,..
Free = FileNeuter

FileNeuter is an AppleScript droplet. Drag a folder to the droplet and it will find and rename all files with Windows reserved characters in their names (folders too).
You can find a link to it here:
http://www.macosxhints.com/article.php?story=20070128173142918

You may also be able to find existing shell scripts for this, but the FileNeuter droplet is probably the easiest route if you are at the individual workstation. It can also be edited if you find other odd character problems beyond the standard windows reserved characters list.

Also, you may be able to push the plain old AppleScript script file to machines then use the "osascript" command from the command line to run it on a designated directory...
 
Back
Top