Python script (Cron). Its funtion to review folder, review pdf files, look for the pattern and move files to the corresponding folder. Python script (file). Its funtion to review file (arg), review pdf files, look for the pattern and move files to the corresponding folder.
pip3 install textract pip3 install PyPDF2
Also, check the requirements.txt file for additional requirements.
The files to transform must be in the folder: /serverfolder/source/
The pattern to search is found in the Line 30 of both files
Example
30 pattern_to_search ='Fecha:(.+?) Hora:' # pattern to search search data between date: and time : .
-
Clone or download the git repository.
-
Add pdf files in the source folder
-
run
python3 searchandmove_cron.py
or
python3 searchandmove_file.py ./serverfolder/source/XXXXXX.pdf