I am trying to tidy up some scripts and merge them into one..
The process is as follows..
- 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.
- 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
- 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
- PPE_000036_1067414, 05/03/2019 07:35
- PPE_000037_1067414, 05/03/2019 08:40
- The next process is to rename the PDF file that was downloaded earlier in the YYYYMMDD folder.
- 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.
- The final process is to move the renamed files to a central location on the network