Batch change file extensions in Mac OS X?
Solution 1
Use Name Mangler to do this. Shareware, but: Trial version: Name Mangler will work for 25 launches without limitation.
You can see the original and future file names on the left, and the configuration of Number Sequentially I used on the right. Important here is to manually define .jpg
suffix, and not appending the original extension.
The free NameChanger also can do this. (thanks slhck!)
Solution 2
I'm assuming you want 1.jpg.1
to be renamed to 1-1.jpg
, or you'll lose them.
Quick and dirty comes to mind: just use sed
to construct a shell script on the fly and have sh
run it:
$ ls -1 *jpg* | sed -e 's@\(.*\)\(\.jpg\.\)\(.*\)@mv \1\2\3 \1-\3.jpg@' | grep ^mv | sh
Strongly suggest you check the output just before the sh
to make sure it's actually going to do the right thing.
Related videos on Youtube
Thalecress
Updated on September 18, 2022Comments
-
Thalecress almost 2 years
I used wget to download a website into a folder. When files have the same names, wget stores the new one as name.extension.#
Now I have hundreds of files like 1.jpg, 1.jpg.1, 1.jpg.2, etc.
How can I change every file with a .jpg* extension into plain .jpg?
EDIT: I used freeware NameChanger, which let me organize by EXIF data before changing the extension.
-
Thalecress about 12 yearsI'm pretty sure that I'll lose
-
brevno about 12 yearsThis doesn't work with filenames that have spaces or some other special characters.