photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: RainerG on May 08, 2021, 03:25:31 PM

Title: How can i renumber my files
Post by: RainerG on May 08, 2021, 03:25:31 PM
I have many files like this:

5113 description a
5113 description b
5114 description c
5115 description d
5116 description e
5117 description f
5118 description g
...
55xx description abcde

You see at the second line is a double number :-(.

Now i will repair the leading numbers into:
5113 description a
5114 description b
5115 description c
5116 description d
5117 description e
5118 description f
5119 description g
...
55xx description abcde

But i find no way with the renamer to set this names.

My first trial:
File Number (# of the file) !!! No way to set an prefix - the field ist grey!!!
Original File Name
SubStr (Start: 5 and all following characters)

But this ist the preview:
5113 description a
5113 description b
5114 description c
5115 description d
5116 description e
5117 description f
5118 description g
...
same like the original!!


The i play with the settings and take File Number at the end:
Original File Name
SubStr (Start: 5 and all following characters)
File Number (# of the file) !!! No way to set an prefix - the field ist grey!!!

description a0001
description b0002
description c0003
description d0004
description e0005
description f0006
description g0007

Very strange!

Same processing instructions only sorted diffently,  but another result with the numbers.

How can i repair the leading numbers of my files with the renamer?
Title: Re: How can i renumber my files
Post by: Mario on May 08, 2021, 04:36:27 PM
The prefix in the file number is disabled because prefix are not supported by that feature.
You can achieve the same effect by just adding a text step before the file number step.

The file number step appends a number to make file names unique, and only if there is a duplicate file name. Since your descriptions differ, no dupe file name, no file number.
I think what you really want is a global sequence number?
Title: Re: How can i renumber my files
Post by: RainerG on May 08, 2021, 05:18:30 PM
QuoteThe file number step appends a number to make file names unique,
I don't use "Unique Number" i use "File Number".

What i need is the filename starting at postion 5 and at the beginning a 4 digit number starting with 5113 to repair the names.

I think i can not do this with the renamer.




Title: Re: How can i renumber my files
Post by: RainerG on May 08, 2021, 05:30:48 PM
Ok, i can start the renaming with pic 5100... (first pic starts with 5000...)
I set
"Text and Variables" --> 51
"Global Sequence Number" --> 2 digits
this gives me the correct numbering

but i need the
"Original File Name" starting at pos 5 to delete the false beginning numbers.
Title: Re: How can i renumber my files
Post by: thrinn on May 08, 2021, 07:15:55 PM
Try this!
You must change the Global Sequence number to the wanted number of the first file, of course.
The "Remove Text" step must have "Regular Expression" checked.
Title: Re: How can i renumber my files
Post by: RainerG on May 10, 2021, 10:09:30 PM
Quote from: thrinn on May 08, 2021, 07:15:55 PM
Try this!
You must change the Global Sequence number to the wanted number of the first file, of course.
The "Remove Text" step must have "Regular Expression" checked.

Big THANK YOU!

It runs :-).
Title: Re: How can i renumber my files
Post by: thrinn on May 11, 2021, 11:09:22 AM
You are welcome.
In fact, this is based on a more generic solution for retaining filename suffixes of variable length, posted by sinus some time ago: https://www.photools.com/community/index.php?topic=8977.0 (https://www.photools.com/community/index.php?topic=8977.0)
So, we both can thank Markus in turn  :)