I need some help from python programmers to solve the issue I'm facing in processing data:-
I have .csv files placed in a directory structure like this:-
-MainDirectory
- Sub directory 1
- sub directory 1A
- fil.csv
- sub directory 1A
- Sub directory 2
- sub directory 2A
- file.csv
- sub directory 2A
- sub directory 3
- sub directory 3A
- file.csv
- sub directory 3A
Instead of going into each directory and accessing the .csv files, I want to run a script that can combine the data of the all the sub directories.
- Sub directory 1
Each file has the same type of header. And I need to maintain 1 big .csv file with one header only and all the .csv file data can be appended one after the other.
I have the python script that can combine all the files in a single file but only when those files are placed in one folder.
Can you help to provide a script that can handle the above directory structure?