Perl script for renaming files in a directory based on a list.
$30-250 USD
Completed
Posted over 11 years ago
$30-250 USD
Paid on delivery
I need a simple Perl script that can tackle the following problem.
1. I have a directory, SomeDirectory, with files in it. The files are names either by a person's name, "Smith,John.jpg" or by an ID number, "800031245.jpg".
2. I have a csv file with 3 columns: Last Name, First Name, and ID number.
3. I need the perl script to get the filename of each file and find out if it matches any row in the list, either by first and last name, or by ID number. If it finds a match, the file should be renamed "LastName, FirstName - ID.jpg". For example, if it finds a file named "Doe, Jane.jpg", and there is a Jane Doe on the list who has a user ID 800023452, it should rename the file to "Doe, Jane - 800023452.jpg". If it finds a file named "80002345.jpg", and there is a 80002345 user ID on the list for "John Doe", it should rename the file "Doe, John - 80002345.jpg"
4. When the script is done, all files that it finds a match to should be renamed to the "Lastname, Firstname - ID.jpg". First letter capitalized on first and last name, no matter what the original capitalization is.
5. One snag - there may be duplicates. If a duplicate is found, the script should ignore/delete the duplicate.
Hi
I have worked on similar problems earlier. Used CPAN modules like Spreadsheet::WriteExcel.
Rest renaming of file and other stuff can also be taken care about.
Regards
Ishita
Greetings, I have made some file manipulation scripts before using Perl or Linux shell scripting, I have seen your example files and I'm confident I can complete your job with no problems.
Please let me know if you're interested.
Thanks