rise the numbers

Bulk Rename Utility How-To's

rise the numbers

Postby chariot » Tue Jan 28, 2020 10:49 am

Hi again!

I would like to rise the numbers with three.

E.g:
before after
2008.215.1. 2008.218.1.
2008.216.1. 2008.219.1.
2008.217.1. 2008.220.1.
2008.218.1. 2008.221.1.

Of course the names should not be duplicated...

Many thanks again! :D
chariot
 
Posts: 2
Joined: Mon Jan 27, 2020 12:37 pm

Re: rise the numbers

Postby therube » Tue Jan 28, 2020 2:03 pm

Make sure your files are listed in the correct order...

5:Remove
From: 6 to: 8

10:Numbering
Mode: Insert, at: 6, Start: 118
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm

Re: rise the numbers

Postby bru » Wed Feb 05, 2020 12:02 pm

Its hard to say without the full filenames. If you've simply removed extensions, you could try brc in a batch:

@echo off
cd "C:\YourFolderPath"
Setlocal EnableDelayedExpansion
For /f "delims=. tokens=1,2,3,4" %%A IN ('dir/b/a-d 20??.???.1.*') DO (
For /f "delims=0 tokens=1*" %%E IN ("%%B") DO (
(Set/a inc="%%E+3")&&(Set inc=00!inc!)
IF NOT "!inc:~-4,1!"=="0" (Set inc=!inc:~-4!) ELSE (Set inc=!inc:~-3!)
brc32 /NoDup /NoFolders /IgnoreFileX /Pattern:"%%A.%%B.%%C.%%D" /Regexp:"^(20|19)(\d\d)\.(\d{1,4})\.(1).(%%D)$:\1\2.!inc!.\4.\5" /Execute))
pause>nul

You can remove /Execute to preview the would-be renames, but the results are like:
2014.1.1 ---------> 2014.003.1
2008.008.1 ------> 2008.011.1
2012.999.1 ------> 2012.1002.1
2112.abc.1 ------> No effect
200a.003.1 ------> No effect
bru
 
Posts: 62
Joined: Wed Jan 31, 2018 7:35 pm


Return to How-To