Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/carlijoy/csv_merge
Merging Files containing the same header - like CSV files
https://github.com/carlijoy/csv_merge
csv merge python3
Last synced: 7 days ago
JSON representation
Merging Files containing the same header - like CSV files
- Host: GitHub
- URL: https://github.com/carlijoy/csv_merge
- Owner: CarliJoy
- License: mit
- Created: 2019-12-01T17:07:19.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-15T13:28:23.000Z (about 4 years ago)
- Last Synced: 2024-12-09T01:34:38.378Z (15 days ago)
- Topics: csv, merge, python3
- Language: Python
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CSV Combine
Script to combine multiple files matching glob in a folder to one single big file.
The common head will be determined automatically based on the number of identical lines of
the first two files.Latest version is available in [GitHub](https://github.com/CarliJoy/csv_merge).
The default script uses binary mode to write files - so no encoding problems should occur.
The header will be always taken from the first file.
Mismatches in headers will be logged.
Usage:
`./csv_combine target.csv source1.csv othersources/*.csv`It is possible to add a verbose parameter as well as --fix-header-lines parameter.
The --fix-header-lines will force the number of header lines instead of determine it with the first two files.```
$ python csv_combine.py --help
usage: csv_combine.py [-h] [-n FIX_HEADER_LINES] [-v]
target_file [source [source ...]]Combine different csv files but keep the header The header will be determined
automatically be comparing the numberof identical lines of the first two
files. Mismatches of headers will be logged.positional arguments:
target_file Path to combination file
source Source files - unix globbing supported (= * and ?
allowed)optional arguments:
-h, --help show this help message and exit
-n FIX_HEADER_LINES, --fix-header-lines FIX_HEADER_LINES
Set the number of of head lines instead of determining
it by comparingthe first two files.
-v, --verbose increase output verbosity```