This Python script processes CSV files in a specified input directory and writes only the valid rows to a new CSV file in an output directory. The script also logs the processing time, the files being processed, and any invalid rows that are skipped.
- Python 3.6 or later
- Clone this repository or download the script
main.py. - Make sure you have Python installed, or download it from Python's official website.
Open a terminal and navigate to the directory containing the script. Then, run the following command:
python main.pyLet's say you have a directory input with the following CSV files:
sample1.csvsample2.csv- ... more csv files
After running the command:
python main.pyNew CSV files e. g. the new sample1.csv will contain only valid rows and will be located in the output directory. Also, a log file named log.txt will be updated with processing details.
For contributing to this project, please feel free to open an issue or submit a pull request.
- Website carlos8a.com
- GitHub @CarlosUlisesOchoa
- X @Carlos8aDev