swestrup: (Default)
[personal profile] swestrup
Am I right that there isn't a half-decent bulk rename command out there for Linux?  I did a search and found a bunch, but they all rely on regex which is not terribly useful when what you want to do is pull a number out of the middle of a file name, do math on it, and depending on the result replace it with a string containing a different embedded number.

(Okay, maybe this can be done with Perls ultra-extended regular expressions, but after rereading how they work a dozen times, and trying 30 different patterns, I gave up as the documentation is inadequate and I haven't been able to figure out how to express this.)

This, by-the-way is what you want to do if you have 1000 files numbered sequentially, from 10 years of a TV show, and you want to rename them as season and episode numbers, and the number of episodes per season was not a constant...

Okay, I know this is an edge case, but if I were to write a bulk rename, this would be one of the things I would, for certain, want to make easy.  Anything less complex and you can just throw together a one-line bash for-loop to handle it.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

January 2017

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 13th, 2026 08:11 pm
Powered by Dreamwidth Studios