Renaming lots of files at once is a bit more sophisticated in Mac OSX than Windows

In my last post – Renaming Multiple Files in Windows – I described multiple file renaming in Windows. Here is Mac’s equivalent.

Suppose I have several photos that I would like to rename to indicate that they were all taken in Brighton. The way that I would do this on a Mac is as follows:

Select all the relevant files (in Finder) by clicking on the first file and then holding down the “shift” key while clicking on the last file (there are two shift keys on most keyboards – they are at the left and righthand edges of the keyboard and have arrows pointing towards the screen – ie away from you).

Right-click the mouse or trackpad and left-click on “Rename x items…” (where “x” is the number of files you have highlighted). Alternatively, click on the “file” command and then left-click on “Rename x items…”.

The first option to note is the dropdown box that currently shows “Replace Text” (see Figure 1). Leave that as it is for now. Note that you can see what the results will look like by referring to the example at the bottom left of the window. Just type in the text that you wish to replace and the text with which you wish to replace it and click on “Rename”. See Figure 2 for the result.

File Renaming on a Mac - Figure 1

Figure 1

File Renaming on a Mac - Figure 2

Figure 2

The next option allows us to add text to the original file names and to choose whether to add it before or after the original file name. This option is accessed by clicking on the dropdown box next to “Replace Text” and choosing, instead, “Add Text”. See Figures 3 and 4.

File Renaming on a Mac - Figure 3

Figure 3

File Renaming on a Mac - Figure 4

Figure 4

The most flexible option is accessed by choosing “Format” in the first option (see Figure 5). Against the option “Name format” we can choose to add either a date, a number (confusingly referred to as an “index”), or a counter to the name. The only difference I can find between “index” and “counter” is that “counter” pads the number out with leading zeroes. “Aah”, you might say, “that’s to make sure that numbers appear in the correct order (eg 099 would appear before 100)”. But Finder already sorts 99 before 100, so I can’t see the advantage. I spent an inordinate amount of time googling to try to find the difference between “index” and “counter” – and failed.

Then, quite confusingly, there is a box labelled “Custom format”. It doesn’t mean “format” at all. It means “Name” as this box just allows you to re-name the “name” part of the file name. Luckily, there is, once more, an example of how your file renaming will look at the bottom left of the renaming window. Other options in this dialogue box are self-explanatory. See Figure 6 for an example of the results.

File Renaming on a Mac - Figure 5

Figure 5

File Renaming on a Mac - Figure 6

Figure 6

A warning. Your Finder may be set to display “file extensions” (see the option Finder / Preferences / Advanced). These are the letters after the final full stop in filenames. In the examples above, the file extension in all cases is “tif”. These file extensions are the means by which the operating system knows which program to use to open a file. Do not touch the file extension when renaming files. This also applies to renaming files in Windows.

If you need more comprehensive renaming options, then third party programs are available. A quick google for “file renaming software” took me to, for instance. I haven’t tried this program, but it does look as if it could satisfy very complicated file naming requirements.

“Illegal” in the rather peremptory manner of “computer-speak” that is..

Earlier this week, a client and I had problems transferring some data from an Apple Mac to a USB pen drive (or “memory stick”, if you insist on using that misnomer) prior to copying it onto a shiny new Windows 8 laptop.

Sopranos - Illegal Character?The copying process kept encountering forward slash and backslash characters contained within the names of files (eg a file’s name might have been “accounts at 31/12/2013”). Every time this happened the copying process just stopped dead with an error message. The problem arises because forward slash and backslash characters are permitted in the file system used by the Apple Mac operating system, but not in either of the two filing systems used by Windows (FAT and NTFS). The USB pen drive had been prepared (“formatted”) to use a Windows-friendly filing system and it just wasn’t going to accept files with “illegal characters”.

Question Mark

Another illegal character. It was very very hard finding images for this post!

What we did about it was to use the Mac’s spotlight (search) feature to list all of the files that included the offending characters and the client then manually changed all the filenames while I had more fun setting up the new laptop. There were a couple of hundred or so file names to change. Had there been thousands, I would have searched online for a utility (program) to automate the process.

How do you avoid such problems? In general, these things are only likely to crop up if you try to move something from a Mac system to a Windows system where there are characters that are illegal in Windows systems. If you think that there’s any chance that you might want to move or copy files in this way then don’t use the characters listed below in a Mac system, even though they are legal. You can’t fall foul of these rules while you stay within one operating system because that operating system won’t let you use a character that is illegal in that operating system’s filing system. The problem is only going to crop up if you transfer files between filing systems.

Mac Illegal Characters

  • :
  • Yep, that’s it. The only illegal character in OS9 and OSX is the colon. Further to that, though, you can’t use a full stop (aka a dot or a period) as the first character in a file name, as this would designate the file as hidden.
  • File and folder names can be up to 255 characters long in the current operating system (OSX), but only 31 characters in OS9.

Windows Illegal Characters

  • / ? < > \ : * | ”^
  • Actually, you can use the caret (“^”) in NTFS, but steer clear of it if you are likely to copy anything to a pen drive as it might be formatted as FAT.
  • I would also recommend steering clear of using a ~ (tilde) as Microsoft Office programs use this for a temporary version of the data file you have open (with a tilde as the first character). By the by, these temporary files are deleted automatically if you close the file correctly. If you find loads of Word documents or Excel spreadsheets on your hard drive whose names beging with a “~” then it’s a sign that you’ve not been closing your files and Office programs properly. As long as the programs are not currently running, it’s safe to delete such files.
  • File and folder names can be up to 255 characters long in FAT and 256 in NTFS.
  • Also, there are some “reserved names” in Windows that have been used to designate specific things (serial and parallel ports, if you must know). So, you can’t use the following as file or folder names – com1, com2, com3, com4, com5, com6, com7, com8, com9, lpt1, lpt2, lpt3, lpt4, lpt5, lpt6, lpt7, lpt8, lpt9, con, nul, and prn.

We’ve only been looking at file names here. Just because a file can be transferred between a Mac and a PC (in either direction) without falling foul of these naming rules doesn’t mean that the receiving system will be able to deal properly with the file. Whether you can actually open and read a file created on another system is dependent on having a program capable of understanding the contents of the file. You can rely on common types of files (such as pdf files and image files) being happy on any system, but proprietory files (eg those produced by accounts systems) may need some “conversion” or “importing” process. Such processes – if they exist – would be found within the program that is going to use the file.

© 2011-2018 David Leonard
Computer Support in London
Privacy Policy Suffusion theme by Sayontan Sinha