Forgot Password
Pentax Camera Forums Home
 

Reply
Show Printable Version 1 Like Search this Thread
08-18-2014, 03:09 AM   #1
Pentaxian




Join Date: Oct 2007
Location: Canberra, Australia
Photos: Gallery
Posts: 2,472
Batch file rename with a twist

I need some help from the good folk of Pentax to rename some files in my archive. In my foolish youth I used to rename my files using YYMMDD_Description_IMGPXXXX but nowdays for a variety of reasons I've decided I would like to use the a different format YYMMDD_IMGPXXXX_Description. Basically, I want to preserve the whole file name but switch the position of the camera generated image number and description. There must be an easy way to do this in a batch but I can't wrap my brain around how to do it. I have far too many files to do this manually. I have both Bridge and Lightroom that I could use for the job.

Thanks in advance

08-18-2014, 04:18 AM   #2
Moderator
Site Supporter
Loyal Site Supporter
MarkJerling's Avatar

Join Date: May 2012
Location: Wairarapa, New Zealand
Photos: Gallery | Albums
Posts: 20,406
I use NAMEXIF by Digicamsoft.com. Having said that, I don't retain the IMGPXXXX, I use date and time only. Have a play with NAMEXIF though - It may be able to do what you want, and it's free.
08-18-2014, 05:52 AM - 1 Like   #3
Veteran Member




Join Date: Feb 2010
Location: East Bay Area
Photos: Gallery
Posts: 811
If you are on PC, Renamer is my favorite tool for doing massive batch renaming. ReNamer « Downloads « den4b.com

You probably can use the "Rearrange" rule (assuming your descriptions don't have the underscore characters). And tell it that split using "_" (without quotes), and new pattern should be $1_$3_$2 to swap the parts as you described.

Preview the new name on the right side of the bottom window make sure they look good before committing the change.
08-18-2014, 07:47 AM   #4
Moderator
Not a Number's Avatar

Join Date: Mar 2012
Location: Venice, CA
Posts: 10,526
Also for the PC:

Advanced Renamer - Free and fast batch rename utility for files and folders

08-18-2014, 08:08 AM   #5
Veteran Member




Join Date: Jan 2010
Location: Michigan
Photos: Gallery
Posts: 2,207
Here is a script in X that will do it, and an outer loop can be added to crawl through all the dirs.
I suppose a win batch file would be somewhat similar.

#!/bin/bash
PR_wkdir=~/Pictures/Rename
PR_resultdir=$PR_wkdir"/Resultfiles/"
PR_ext=".tif"

cd $PR_wkdir
mkdir -p $PR_resultdir
for file in *; do
if [ ${file: -4} == $PR_ext ]; then
echo "***"
echo $file
PR_Basename=$(basename $file $PR_ext)
IFS="_"
PR_Num=0
for i in $PR_Basename ; do
PR_Num=$((PR_Num+1))
PR_ID[PR_Num]=$i
done
unset IFS

if [ $PR_Num == "3" ]; then
PR_Newname="${PR_ID[1]}""_""${PR_ID[3]}""_""${PR_ID[2]}"
echo $PR_resultdir$PR_Newname$PR_ext
cp $file $PR_resultdir$PR_Newname$PR_ext
# rm $file
else
echo "Wrong name format, not copied"
fi
fi

done
08-18-2014, 08:08 AM   #6
Site Supporter
Site Supporter
Miguel's Avatar

Join Date: Sep 2007
Location: Near Seattle
Photos: Gallery
Posts: 2,743
For Macs, A Better Finder Rename is quite powerful and easy to use.

I'm curious why you even feel the need to rename your files to begin with?

With Lightroom it seems easier and more sustainable to use metadata, key words, collections as ways to identify the file's contents and genesis.

M
08-18-2014, 05:20 PM   #7
Pentaxian




Join Date: Oct 2007
Location: Canberra, Australia
Photos: Gallery
Posts: 2,472
Original Poster
Thanks for the suggestions thus far, I'm on PC so I'll give Renamer a try.

QuoteQuote:
I'm curious why you even feel the need to rename your files to begin with?
The main reason is so that the files can be sorted chronologically using the file name only. Currently the files appear in date order but because the description is before the image number within each date the files are ordered according to the alphabetical order of the description, I'd like them to appear in shooting order without having to sort by other fields like date created etc.

08-18-2014, 08:49 PM   #8
Pentaxian




Join Date: Oct 2007
Location: Canberra, Australia
Photos: Gallery
Posts: 2,472
Original Poster
Renamer did exactly as I wanted, many thanks for the tips!
Reply

Bookmarks
  • Submit Thread to Facebook Facebook
  • Submit Thread to Twitter Twitter
  • Submit Thread to Digg Digg
Tags - Make this thread easier to find by adding keywords to it!
batch, files, photography, photoshop

Similar Threads
Thread Thread Starter Forum Replies Last Post
batch renaming file extensions? barondla Digital Processing, Software, and Printing 19 07-25-2014 07:46 AM
How to batch rename files after files imported and tagged in Photoshop Elements raider Digital Processing, Software, and Printing 5 03-14-2013 10:36 PM
Streets Chair: with a twist..... arbib Post Your Photos! 4 01-03-2010 02:04 PM
A familiar verse with a bit of a twist - Year II daacon General Talk 5 12-24-2009 09:41 PM
Grass with a twist... heliphoto Post Your Photos! 16 06-25-2009 07:54 AM



All times are GMT -7. The time now is 03:07 PM. | See also: NikonForums.com, CanonForums.com part of our network of photo forums!
  • Red (Default)
  • Green
  • Gray
  • Dark
  • Dark Yellow
  • Dark Blue
  • Old Red
  • Old Green
  • Old Gray
  • Dial-Up Style
Hello! It's great to see you back on the forum! Have you considered joining the community?
register
Creating a FREE ACCOUNT takes under a minute, removes ads, and lets you post! [Dismiss]
Top