#1 2010-08-07 21:56

jer73
Member
Registered: 2010-08-07
Posts: 1

Use last X char from Filename

I used to rename photo files to date followed by the foto index number. So IMG_7356.jpg would become 2010-08-03_7356.jpg. How do I do that with ReNamer?
Getting the date from the EXIF-info is straightforward. But how do I retrieve the last 4 digits from a filename with Renamer?  I have files like:
IMG_7356.jpg
BILD1473.JPG
310720100214.jpg
MVI_7357.avi

Any suggestions? I couldn't find it in the manual and may need some guidance on regular expressions??
Regards, Jeroen

Offline

#2 2010-08-07 22:34

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: Use last X char from Filename

Try with this before adding the date.

Delete:
From Position 5
Till de end
[x] Skip Extension
[x] Right-to-left


If this software has helped you, consider getting your pro version. :)

Offline

#3 2010-08-07 22:43

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Use last X char from Filename

Hi Jeroen, welcome.

jer73 wrote:

I used to rename photo files to date followed by the foto index number.
So IMG_7356.jpg would become 2010-08-03_7356.jpg. How do I do that with ReNamer?
Getting the date from the EXIF-info is straightforward.
But how do I retrieve the last 4 digits from a filename with Renamer? 
I have files like:
IMG_7356.jpg
BILD1473.JPG
310720100214.jpg
MVI_7357.avi

Any suggestions? I couldn't find it in the manual and may need some guidance on regular expressions??
Regards, Jeroen

Yes, RegEx would be easy.
1) RegEx: Replace expression ".+(....)" with "$1" (skip extension)

PascalScript too.
FileName := copy(string, Length(string)-5, 999);



But i can't find an user friendly doing for this standard issue.

The best way is maybe this:

FROM:
IMG_7356.jpg
BILD1473.JPG
310720100214.jpg
MVI_7357.avi
TO:
7356.jpg
1473.JPG
0214.jpg
7357.avi
DO this two steps:
IMG_7356.jpg
1) Insert: Insert "#" at Position 5 (right-to-left) (skip extension)
IMG_#7356.jpg

2) Delete: Delete from Position 1 until Delimiter "#" (skip extension)
7356.jpg


HTH? big_smile

Happy ReNaming!


EDIT:

SafetyCar wrote:

Try with this before adding the date.

Delete:
From Position 5
Till de end
[x] Skip Extension
[x] Right-to-left

lol Bravo  SafetyCar

One have to think about this possibility at first place roll
I have tried 'Right-to-left' with 'Count' only.

Anyway, no Jeroen has several possibilities to choose from big_smile

Last edited by Stefan (2010-08-07 22:52)


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

Board footer

Powered by FluxBB