Difference between revisions of "MELRandomRename"

From scripting
Jump to: navigation, search
(Created page with " global proc RandomRename(string $SearchStr, string $ReplStr) { //Bernice Ngo and Nick Pisca 2010 string $VMF_Obj[] = `ls -tr $SearchStr`; int $VMF_ObjSize = `size($V...")
 
(No difference)

Latest revision as of 07:17, 22 April 2017

global proc RandomRename(string $SearchStr, string $ReplStr) {
  //Bernice Ngo and Nick Pisca 2010
  string $VMF_Obj[] = `ls -tr $SearchStr`;
  int $VMF_ObjSize = `size($VMF_Obj)`;
  if ($VMF_ObjSize != 0) {
     int $random = rand (0, $VMF_ObjSize);
     rename $VMF_Obj[$random] $ReplStr ;
  }
}