Kangry.com [insert cool graphic here]
home | Topics | Logout | Search | Contact | ?? Kangry ?? | Bandwitdh
Topics:
DVR
nvrec
Mplayer
Links
Misc
Commands
Humor

Name

Password

New user

uploaded files
(linux_command_line)-> (Parent)->complex renaming submited by Russell Wed 14 Feb 07
Web kangry.com
there might well be a trick to do this on thc command line, but I'm not that skilled. to do what you described, I wrote a simple perl program:
open (IN, "ls music[0-9][0-9]*.mp3|");
do{
$line=<IN>;
chomp $line;
$newname=substr($line,0,7).".mp3"; ## builds new name using first 7
                                   ##chars of oldname
if (!-e $newname) ## don't try if the new name already exits
  {
  print `mv -vi '$line' '$newname'`;
  };
} until eof(IN);

paste this into a perl (text) file (music_renamer.pl) then run it with the command perl music_renamer.pl with the files you want to change in the current directory.

This Should be safe, because it won't overwrite an existing file, but non-the-less, you should backup your files first incase something goes terribly wrong.


Add comment or question...:
Subject:
Submited by: NOT email address. Leave blank for anonymous    (Spam Policy)

Enter Text: (text must match image for posting)




This file (the script that presented the data, not the data itself) , last modified Wednesday 03rd of December 2014 09:40:39 AM
your client: CCBot/2.0 (http://commoncrawl.org/faq/)
current time: Thursday 25th of May 2017 04:38:34 AM