Description
This script helped me take dozens of csv files and combine them into one large csv file.
You just drop all the csv files into the work folder, run the script and it spits out a combined csv file.
Instructions
Setup
- Create a project folder with a sub-folder named
work
. - Copy the
requirements.txt
file (below) to the root of your project folder. - Create a python virtual environment in your project folder:
$ python3 -m venv .venv
- Activate the virtual environment:
$ source .venv/bin/activate
- Install the project requirements
$ pip install -r requirements.txt
- Copy the
example.py
file (below) to the root of your project folder.
Usage
- Place multiple csv files into the ‘work’ folder.
- To process the csv files run the python script,
$ python example.py
- If successfull, a new file named,
combined.csv
should now exist in the ‘work’ folder.
requirements.txt
1 | numpy==1.22.3 |
example.py [1]
1 | import os |