Re: how to rename multiple files?


Subject: Re: how to rename multiple files?
From: Justin Dieters (Yahoo) (enderak@yahoo.com)
Date: Fri Feb 22 2002 - 13:17:19 AKST


Thanks. I was thinking i'd probably need to use awk and/or sed - I guess
I'll be giving myself a crash course on it tonight...

Justin

----- Original Message -----
From: "James Bagley Jr." <james@thelostnet.net>
To: "Justin Dieters (RPKA)" <justind@rpka.net>
Cc: "Alaska Linux Users Group" <aklug@aklug.org>
Sent: Friday, February 22, 2002 12:19 PM
Subject: Re: how to rename multiple files?

>
> You will have to play with the formatting a little, but:
>
> for file in *
> do
> mv $file `echo $file | awk -F\- '{ print $3 "-" $4 }'`
> done
>
> On Fri, 22 Feb 2002, Justin Dieters (RPKA) wrote:
>
> >
> > Hello all. I'm sure this is possible with some sort of script
mumbo-jumbo,
> > but I was hoping there was a quick and dirty solution. Is there a way
to
> > rename more than one file at the same time? For example, my mp3 files
are
> > currently in the format of 'Artist - Album - Track# - Name.mp3' and I
want
> > to rename them all to just 'Track# - Name.mp3' because they currently
are
> > too long for their names to fit properly on a CD.. currently everything
> > more than 64 characters gets chopped off... It gets tedious renaming
dozens
> > and dozens of files.. :)
> >
> > Thanks,
> > Justin
> >
> >
> >
> >
> >
> >
> >
> >
>
> --
> ... Any resemblance between the above views and those of my employer,
> my terminal, or the view out my window are purely coincidental. Any
> resemblance between the above and my own views is non-deterministic. The
> question of the existence of views in the absence of anyone to hold them
> is left as an exercise for the reader. The question of the existence of
> the reader is left as an exercise for the second god coefficient. (A
> discussion of non-orthogonal, non-integral polytheism is beyond the scope
> of this signature.)
>
>
>

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



This archive was generated by hypermail 2a23 : Fri Feb 22 2002 - 13:17:23 AKST