Procedure - Rename a PDF document and move it to a specific folder on the network

Good Morning,

I am trying to tidy up some scripts and merge them into one..

The process is as follows..

  1. PDF is automatically downloaded to a folder - The folder name is based on the current date - Format YYYYMMDD - The PDF document is named as follows PPE_000035_1067414.pdf.  PPE_??????_???????.pdf the letters are always standard but the numbers always change.

  1. The next process is that a CSV file is automatically downloaded named as follows 'template_c9b825a390544c7b98b57022e0593e44.csv' stored in a folder. Within this file I need extract the PDF ID and the date. There can be multiple entries. See example file
  2. template_c9b825a390544c7b98b57022e05.csv
  3. From this CSV file I want to extract  rows where datetime      Date: and textsingle      PPE No. - are shown columns A & B then extract the corresponding data in column C but each of set of data starts from section Title Page. The data extracted in the example should be as follows and saved in a file
  4. PPE_000036_1067414, 05/03/2019 07:35
  5. PPE_000037_1067414, 05/03/2019 08:40
  6. The next process is to rename the PDF file that was downloaded earlier in the YYYYMMDD folder.
  7. I would like the script to search for the PDF folder document in the YYYYMMDD folder based on the data that was extracted from the CSV file, 1st Column name of PDF File and once a match has been found append the data at the end of the filename. Removing any illegal characters etc and adding underscore as the separators.
  8. PPE_000036_106714_05_03_2019_07_35_AM.pdf
  9. The final process is to move the renamed files to a central location on the network
NICK COLLINSAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gustav BrockCIOCommented:
Nick, please have in mind, that we all are volunteers - you can't expect to receive complete solutions to a very special task that seems like a job for a paid consultant.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.