I have a folder full of png images that's file names are too long for a program that I'm feeding them to. Ideally, I'd like to rename every image in the folder to be just characters 59-68 of it's current filename. If that's not possible then I'd like to rename it to characters 59-73 (59-the end) of it's current filename. if that's also not possible then I'm fine to make them all just integered. i.e file0001, file0002, file0003 etc.
Could imagemagick do any of this? I've found a bunch of stuff about resizing and renaming, but nothing just about renaming.
Thanks for the help!
How to just rename each image in a folder
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How to just rename each image in a folder
ImageMagick reads images and writes them. It would be highly inefficient to do this when you just want to rename them.
snibgo's IM pages: im.snibgo.com
Re: How to just rename each image in a folder
Valid point, and I know, but I'm not sure of any other way. It's going to be more efficient than clicking and deleting the image filename by hand. If you have any idea how to do this in command prompt or anything, it'd be appreciated.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How to just rename each image in a folder
It's a scripting problem, using whatever command your shell uses to rename files. The hardest part is probably inventing the new names, ensuring they don't already exist. Quite simple in Windows, as files also have 8.3 names (at least, up to Windows 7; I don't know about Windows 8 ).
Last edited by snibgo on 2013-08-29T14:10:57-07:00, edited 1 time in total.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to just rename each image in a folder
What platform are you using? Linux, Mac, Windows?
Re: How to just rename each image in a folder
I'm running Windows 7
Re: How to just rename each image in a folder
Just found this, might work! Thanks for the help anyway guys.
http://www.howtogeek.com/111859/how-to- ... ple-files/
http://www.howtogeek.com/111859/how-to- ... ple-files/
- GreenKoopa
- Posts: 457
- Joined: 2010-11-04T17:24:08-07:00
- Authentication code: 8675308
Re: How to just rename each image in a folder
IM isn't the right tool for this, but file renaming is a crowded category so you have endless options. Many tools will let you include image properties and metadata in your filenames. Some will let you create hard or soft links, which may be useful if you have just one progrm/step that requires the rename. Here is one list of Windows options.
http://www.techsupportalert.com/best-fr ... tility.htm
Alternatively, any scripting language can do this.
I use Flexible Renamer and Perl. Both are portable and support regular expressions, but neither is anything special.
http://www.techsupportalert.com/best-fr ... tility.htm
Alternatively, any scripting language can do this.
I use Flexible Renamer and Perl. Both are portable and support regular expressions, but neither is anything special.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to just rename each image in a folder
I have perl scripts "mv_renum" and "mv_perl" which allows you to rename or renumber files in particular ways
They are available in my personal software export.
http://www.ict.griffith.edu.au/anthony/ ... /#mv_renum
They are available in my personal software export.
http://www.ict.griffith.edu.au/anthony/ ... /#mv_renum
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/