in reply to Re: Renaming Multiple Files with Different Names
in thread Renaming Multiple Files with Different Names

I am just using the rename function in command line.

rename 001.tabular 3972

As I read your code, it is renaming the files by simply adding the extension of .foobar to each one. I need to completely rename them, so I need to designate $old as $ARGV[0] and $new as $ARGV1 from a text file but it needs to be the column and not the element of the array.

Even when the file doesn't exist, if I change the "%03d" it still says won't clobber. If I can fix that code to rename the files as the value of column 1 that I am sorting on, I don't have to worry about the renaming code. But when I make changes to the code, I either get won't clobber or still get the exact same names as before (that have no meaning and need to be changed).

Replies are listed 'Best First'.
Re^3: Renaming Multiple Files with Different Names
by NetWallah (Canon) on Nov 02, 2011 at 17:10 UTC
    This may achieve what you are trying to do. Your first column is "$key". If you want the files generated to use this, Just replace the corresponding line with:
    $file{$key}{sequence} = $key; # Old stuff was : sprintf '%03d +.tabular', $file{$key}{ID};

                "XML is like violence: if it doesn't solve your problem, use more."

      Perfect it worked. Thanks so much NetWallah!