# Need a program or technique to rename files in sequences

**URL:** <https://boards.straightdope.com/t/need-a-program-or-technique-to-rename-files-in-sequences/626596>\
**Category:** Factual Questions\
**Created:** [June 28, 2012, 4:18pm UTC](https://boards.straightdope.com/t/need-a-program-or-technique-to-rename-files-in-sequences/626596 "2012-06-28T16:18:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![SenorBeef](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senorbeef/32/2220_2.png) [@SenorBeef](https://boards.straightdope.com/u/SenorBeef)\
**Post date:** [June 28, 2012, 4:18pm UTC](https://boards.straightdope.com/t/need-a-program-or-technique-to-rename-files-in-sequences/626596/1 "2012-06-28T16:18:04Z")

</div>

I’m going to have a series of files like file1 file2 file3 - hundreds of these files. I need to be able to cut out any file(s) and then rename all subsequent files to maintain the sequence.

In other words, if I have file1, file2, file3, file4, file5, file6, file7, I need to be able to delete file3 and file4 and have something rename file5 to become the new file3, file 6 to become the new file4, etc.

ie the sequence should go from file1, file2, file3, file4, file5, file6, file7, delete file3/file4, then become file1, file2, file3(originally file5), file4(originally file6), file5(originally file7)

Is there a program or some sort of batch commands or something I can do to achieve this?

---

<div class="post-metadata">

**Author:** ![yoyodyne](https://avatars.discourse-cdn.com/v4/letter/y/a9a28c/32.png) [@yoyodyne](https://boards.straightdope.com/u/yoyodyne)\
**Post date:** [June 28, 2012, 4:25pm UTC](https://boards.straightdope.com/t/need-a-program-or-technique-to-rename-files-in-sequences/626596/2 "2012-06-28T16:25:26Z")

</div>

You can do it pretty easily with [Bulk Rename Utility](http://www.bulkrenameutility.co.uk/Main_Intro.php), either with the GUI or the command-line version.

---

<div class="post-metadata">

**Author:** ![redtail23](https://avatars.discourse-cdn.com/v4/letter/r/3e96dc/32.png) [@redtail23](https://boards.straightdope.com/u/redtail23)\
**Post date:** [June 28, 2012, 4:31pm UTC](https://boards.straightdope.com/t/need-a-program-or-technique-to-rename-files-in-sequences/626596/3 "2012-06-28T16:31:51Z")

</div>

Yup. I use [AF5](http://www.fauland.com/af5.htm); different program that does the same thing.

---

<div class="post-metadata">

**Author:** ![SenorBeef](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senorbeef/32/2220_2.png) [@SenorBeef](https://boards.straightdope.com/u/SenorBeef)\
**Post date:** [June 28, 2012, 4:43pm UTC](https://boards.straightdope.com/t/need-a-program-or-technique-to-rename-files-in-sequences/626596/4 "2012-06-28T16:43:33Z")

</div>

Neither of those are terribly user friendly. Would you mind giving me instructions on how I’d accomplish my specific task? You could use generic examples.

---

<div class="post-metadata">

**Author:** ![yoyodyne](https://avatars.discourse-cdn.com/v4/letter/y/a9a28c/32.png) [@yoyodyne](https://boards.straightdope.com/u/yoyodyne)\
**Post date:** [June 28, 2012, 4:50pm UTC](https://boards.straightdope.com/t/need-a-program-or-technique-to-rename-files-in-sequences/626596/5 "2012-06-28T16:50:39Z")

</div>

Is that the actual file name format, numbers at the end? How many digits and are they zero-padded? What controls the order of the names if the numbers are at the end, is it just alphabetical?

ETA Are there duplicate names if the numbers are removed?

---

<div class="post-metadata">

**Author:** ![SenorBeef](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senorbeef/32/2220_2.png) [@SenorBeef](https://boards.straightdope.com/u/SenorBeef)\
**Post date:** [June 28, 2012, 4:55pm UTC](https://boards.straightdope.com/t/need-a-program-or-technique-to-rename-files-in-sequences/626596/6 "2012-06-28T16:55:09Z")

</div>

It’s a sequence from a digital camera, so it’s very uniform. The files are K500XXXX.jpg and .dng

In this case, I will be removing K5001841.jpg (and .dng) through K5002388.jpg

I want K5002389 through K5002468 to become the new K5001841 through K5001920

Of course in this case I could just manually rename the 150 or so files, but I plan on using this technique again so I would like to find a way to automate it.

---

<div class="post-metadata">

**Author:** ![yoyodyne](https://avatars.discourse-cdn.com/v4/letter/y/a9a28c/32.png) [@yoyodyne](https://boards.straightdope.com/u/yoyodyne)\
**Post date:** [June 28, 2012, 5:23pm UTC](https://boards.straightdope.com/t/need-a-program-or-technique-to-rename-files-in-sequences/626596/7 "2012-06-28T17:23:22Z")

</div>

How I’d go about it in BNR (box #)

Select the folder  
(12) _.jpg  
Select file K5002389.jpg through K5001920.jpg  
(5) Last n=4  
(10) Mode Suffix, Start=1841, Incr.=1  
Rename  
(12)_.dng  
Select file K5002389.dng through K5001920.dng  
Rename

You could select and rename all of each file type at once if they are all numbered without gaps (If zero-padded select number of pad digits in box 10).

---

<div class="post-metadata">

**Author:** ![SenorBeef](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senorbeef/32/2220_2.png) [@SenorBeef](https://boards.straightdope.com/u/SenorBeef)\
**Post date:** [June 28, 2012, 5:28pm UTC](https://boards.straightdope.com/t/need-a-program-or-technique-to-rename-files-in-sequences/626596/8 "2012-06-28T17:28:34Z")

</div>

Perfect, that works, thanks a lot.

---

<div class="post-metadata">

**Author:** ![yoyodyne](https://avatars.discourse-cdn.com/v4/letter/y/a9a28c/32.png) [@yoyodyne](https://boards.straightdope.com/u/yoyodyne)\
**Post date:** [June 28, 2012, 5:35pm UTC](https://boards.straightdope.com/t/need-a-program-or-technique-to-rename-files-in-sequences/626596/9 "2012-06-28T17:35:57Z")

</div>

I meant select file K5002389 through K5002468 but I guess you figured that out 😃
