Hi,
Until recently I renamed all my files as YYMMDD###, however I now rename to YYYYMMDD### as I have started scanning in more pre-2000 photos.
I normally use the the Batch Rename Name Template "<Date Taken [Ymd]>" with duplicate set to ### without any problems. However, if I delete a photo and want to rename the remainder, I used to be able to select the batch, press F2 and the auto-name template ######### would handle the rename. Now that the template is ###########, it seems to get confused.
eg.
If the first filename is "20091101001.JPG", it detects the starting number as 2911231817 rather than 20091101001.
When the first filename is "2009110101.JPG", it detects the starting number correctly as 2009110101 with a name template of ##########.
When the first filename is "091101001.JPG", it detects the starting number correctly as 91101001 with a name template of #########.
Am I doing something wrong or is the number too large for XnView.
Regards,
Jason
Batch Rename ###########
Moderators: helmut, XnTriq, xnview
Re: Batch Rename ###########
Yes, it seems that the number is too large for XnView.jasonc74 wrote:Am I doing something wrong or is the number too large for XnView.

Applications doesn't have to be 64-bit to handle 64-bit integers so this problem could be fixed in the future.

XnView Tweak UI - Tool to customize your XnView beyond the regular XnView options.
UI-less Settings - Documentation of all the hidden settings in XnView.
XFAM - Tool to create and customize XnView file associations.
UI-less Settings - Documentation of all the hidden settings in XnView.
XFAM - Tool to create and customize XnView file associations.
Re: Batch Rename ###########
The reason I moved from ## to ### for the duplicate is that I am sometimes taking more than 99 photos in a single day.
I will change the duplicate to _### and revise my naming format to YYYYMMDD-###.
Now I just need to work out the easiest way to rename all my existing "YYYYMMDD### Description" files to "YYYMMDD-### Description". I can't use <Date Taken [Ymd]> as some of the photos are scans and therefore don't have EXIF dates.
Thanks,
Jason
I will change the duplicate to _### and revise my naming format to YYYYMMDD-###.
Now I just need to work out the easiest way to rename all my existing "YYYYMMDD### Description" files to "YYYMMDD-### Description". I can't use <Date Taken [Ymd]> as some of the photos are scans and therefore don't have EXIF dates.
Thanks,
Jason
Re: Batch Rename ###########
In the end I just used a dir /s /b command to generate a file list and then used Excel LEFT & RIGHT commands to split the filename and create a batch file to add the "-". This also preserved any trailing description I have after the -###.
I'm sure I could have found a utility to do this for me but as a once off I thought this would just be easier.
Regards,
Jason
I'm sure I could have found a utility to do this for me but as a once off I thought this would just be easier.
Regards,
Jason
Re: Batch Rename ###########
Perhaps, this could be done with strings instead of integers. Here is a script.
To try, save the code in file C:/Scripts/Y2K.txt. The code is in biterscripting ( http://www.biterscripting.com ) scripting language. Run the script with this command in biterscripting.
script "C:/Scripts/Y2K.txt" dir("C:/test")
It will rename all .jpg files in C:/test folder according to the coded algorithm. (I have not tested the script. So, please test in a test folder first.)
Code: Select all
# Script Y2K.txt
var string dir, list, path, file, name, prefix
cd $dir
find -n -r "*.jpg" > $list
while ($list <> "")
do
lex "1" $list > $path ; stex -p "^/^[" $path > $file ; stex "]^.^l" $file > $name
if ( { chen $name } == 9 )
do
# This file name is yymmdd. Make it yyyymmdd. If yy is < 50, we will make it 20yy.
# If yy >= 50, we will make it 19yy.
var integer year
set $year = makeint( str ( { chex -p "2]" $name } ) )
if ($year < 50)
set $prefix = "20"
else
set $prefix = "19"
endif
set $file = $prefix+$file
system rename ("\""+$path+"\"") ("\""+$file+"\"")
done
endif
done
To try, save the code in file C:/Scripts/Y2K.txt. The code is in biterscripting ( http://www.biterscripting.com ) scripting language. Run the script with this command in biterscripting.
script "C:/Scripts/Y2K.txt" dir("C:/test")
It will rename all .jpg files in C:/test folder according to the coded algorithm. (I have not tested the script. So, please test in a test folder first.)