A simple program to automate file renaming for ChemStation printText files on GCSCD3.
Uses watchdog to handle and create sys alarms that monitor folder changes. See example pdf for file format. This script will open a pdf that is default named to 'PrintText.pdf" and placed in the target path, look at the fourth line of text that contains the data file name, parse out the data file name, and rename the pdf to 'PrintText{data_file}.pdf'.
The required modules are listed in requirements.txt. Use pip install {module} to install the necessary modules.
target path: C:\Users\oilgas\Desktop\PDF
- Install python from the [official site] (https://www.python.org/downloads/) by clicking "Download Python 3.XX.X".
- during installation check the box for "Add python.exe to PATH, it doesn't hurt to install using admin privileges as well
- In the windows search bar type "manage app execution aliases" and find the two App Installers with the subtitles "python.exe" and "python3.exe", turn both off. In a new cmd terminal (Win + R, type "cmd" and enter), enter
pythonto test if the install worked. Enterquit()to exit the python app. - In the cmd terminal, type the command
cd Desktop\printText-renamerto change your current directory. Install the dependencies for the auto-renamer by typing the commandpip install -r requirements.txt.
- PyPDF2 allows for merging of files, this means that the corresponding quant file can be merged with the PrintText to consolidate the number of files being created
- It would be good practice to set up a testbench for this program
- Set up logging