Bulk Rename
Feb. 14th, 2009 01:46 amAm 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.
(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.