The file combination tool does the following
The tool handles file types DOCX, PPTX, and PDF.
It combines coversheets with files and fills in the filename with the name of the main file and the name of supplementary material files.
It changes dates to year-mo-da format.
It fills in the extent.
Requirements
python, pandas, PyPDF2, docx2pdf, spire-presentation, moviepy.
Installation
Python
Ensure Python is installed in your system.
In Windows search bar, type Command prompt or cmd.
Type python -V
It will show python version. Ensure it is 3.2 or higher.
Install pip packages
In the command prompt type these commands separately or download requirements.txt-
Pandas:
pip install pandas
PyPDF2:
pip install PyPDF2
docx2pdf:
pip install docx2pdf
spire-presentation:
pip install spire-presentation
moviepy:
pip install moviepy
If requirements.txt is downloaded then copy the complete path where this file got downloaded-
pip install -r PATH/requirements.txt
How to run the tool
Ensure all necessary dependencies are installed
If the spreadsheet that you’re working on doesn’t already contain columns AD, Main_file, and AE, Additional_file, add those columns to it
In the Main_file column, fill in the name of the coversheet followed by a comma, followed by the name of the file
In the Additional_files column, fill in the names of any supplementary files
Download the script:
Double click on the script or type in command prompt python File_combine_tool.py
Browse and select the Excel file containing the list of files to be combined.
Browse and select the input folder containing the files listed in the Excel file.
Browse and select the output folder where the combined files will be saved.
Click the "Combine Files" button to start the file combination process.
Once the process is complete, a message box will indicate successful completion, and the program will close after pressing OK.
Once the process is complete, check if all the files are in the output folder.
Check excel file. If file is not combined properly or some error is encountered, it will show “Please combine files manually” instead of the filename. Combine these files manually then.
Check the same thing for extent. Error- “Please fill manually”. Do it manually.
Notes
Ensure file names match the names written in excel sheet. (Filenames in the excel sheet should be written along with their extensions. PDF file names with or without extensions are ok)
Close the excel file before running the tool.
Ensure all files and coversheets are in the input folder.