[Nottingham] Batch file renaming

Michael Quaintance penfoldq at penfoldq.co.uk
Sun Jul 20 14:03:15 BST 2008


On Sun, Jul 20, 2008 at 01:35:56PM +0100, Martin wrote:
> Second thought just in case you might have /folders/ named
> blah.blah.128k that you don't want renaming, use:
> 
> Martin wrote:
> > Michael Quaintance wrote:
> > [---]
> >> want all have names like "01 - Beat It.mp3.128kbps". The files are 
> >> arranged in folders of the artist and album.
> >>
> >> Could someone suggest a way to rename all these files so as to strip the 
> >> trailing ".128kbps" and leave the rest of the filename and folder names 
> >> intact?
> > 
> > find . -name '*.128k' -print | while read n ; do mv -v "${n}"
> > "${n%.128k}" ; done
> 
> find . -type f -name '*.128k' -print | while read n ; do mv -v "${n}"
> "${n%.128k}" ; done

Thankyou. That's the ticket. It was the bash "while, do, move" that was 
troubling me.  

> > BTW: When are you flying?

I fly to the US of A in a little over a week. Next Monday morning (28th) 
and start my new job the Monday after that. I've still got to get my 
bank account sorted and a few other little bits but I'm mainly ready.

> > Any partying??!

There has been too much partying. I've been thrown out of Via Fossa 
twice now for being too drunk. They shouldn't do £1.50 for any pint on 
Thursday nights. It leaves me very ill on Fridays. But unfortunately, no 
more partying in Nottingham. I have been on holiday with my parents 
until yesterday and am now staying with them until I fly. 

I'll remain on this list in the states and I may even return if I really 
don't like it over there. Having never even visited America, I don't 
know what I'm letting myself in for!

All the best to everyone still in Blighty. I don't know what I'll miss 
about the UK but I'm sure there will be something.

-Penfold



More information about the Nottingham mailing list