Feb. 14th, 2009

swestrup: (Default)
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.
swestrup: (Default)
Had trouble sleeping last night, and was woken up after only about 6 hours by various sorts of sinus and stomach upsets. I figured it would probably be best if I spent an hour or so upright before trying to get any more sleep.  In which case the fact that I made myself coffee could be taken as evidence that I'm stupid. We'll see.

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 May. 16th, 2026 03:59 pm
Powered by Dreamwidth Studios