Link to home
Start Free TrialLog in
Avatar of NICK COLLINS
NICK COLLINS

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial