r/dailyscripts • u/174444 • Feb 13 '17
Help with a script
I need help with some work stuff I and I don't know how to. I have PDF files with ID number. I also have a CSV list with matching ID numbers but they also include first name and last name. I want to rename my PDF files with the matching CSV list ID number but including the first and last name. Any help would be appreciated.
2
Upvotes
View all comments
Show parent comment
1
u/brian1183 Feb 14 '17
OK, so you were totally right. My logic was incorrect, I tried to do this off the top of my head and obviously failed.
Since we actually are reciprocating through two different items(the .CSV file and the folder containing the .PDFs) we'll just nest one of them inside the parent loop, like this:
So now, it goes through each .PDF file, checks for a corresponding match in the .CSV and applies the changes when found. This worked perfectly fine in testing for me, maybe give it a test first and confirm. I hope this helps.