Hello,
I'm very novice, and have tried my hand at this problem:
I have 1000s of PDFs named arbitrarily and non-uniformly by a scanning vendor (nothing at all like the sample here). I need to rename them all with unique and uniform filenames.
I have the paths to all the files, and the metadata needed to uniquely name them. I thought I could create a Perl script that would use an array with the original filepath/name and an array with the new filepath/name to rename.
Thus far I have this:
#!/usr/bin/perl use warnings; use strict; use diagnostics; use File::Copy; # Set up arrays with original name and new name with unique ISBN my @IDI_name = ('I:\Production\TEST\P001.txt', 'I:\Production\TEST\P00 +2.txt'); my @PLL_name = ('I:\Production\TEST\ISBN_Text.txt', 'I:\Production\TES +T\ISBN2_Text.txt'); # Walk through array and copy with new filename foreach my $IDI_name (@IDI_name) { copy("$IDI_name", "$PLL_name"); }
The new name is giving me an explicit package name error, but I can figure out how to declare that variable.
So, is my approach entirely wrong?
How do I declare that variable?
In reply to Renaming multiple files with unique identifiers by reedkm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |