Re: mass rename help

Top Page
Attachments:
Message as email
+ (text/plain)
+ junk-mv.cmd (text/plain)
+ (text/plain)
Delete this message
Reply to this message
Author: kitepilot@kitepilot.com
Date:  
To: Main PLUG discussion list
Subject: Re: mass rename help
Dazed_75 writes:

> I have a bunch of files named "meetthegimp=mobile999.mp4" where 999 is any
> 3 digit number. I want to rename them all to be
> "meetthegimp999-mobile.mp4".

WoW, cool commands, didn't know any of them, that's why I like this list... :)

I'm lazy to learn new stuff though, and untrusty of any brick I didn't build, so I'll chip in my simple (to me) solution:

ls|while read FILE;do
    echo "mv $FILE $(echo "$FILE"|sed -e 's/\(meetthegimp\)=\(mobile\)\([[:digit:]]*\)\(\.mp4\)/\1\3-\2\4/g')"
done > /tmp/junk.cmd


Inspect /tmp/junk.cmd and:

. /tmp/junk.cmd

Eat your banana... :)
ET
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss