Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/curtisalexander/csvkeep
Filter a CSV file - only keeping specific columns.
https://github.com/curtisalexander/csvkeep
Last synced: 1 day ago
JSON representation
Filter a CSV file - only keeping specific columns.
- Host: GitHub
- URL: https://github.com/curtisalexander/csvkeep
- Owner: curtisalexander
- License: mit
- Created: 2015-10-05T19:20:44.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-14T21:05:42.000Z (almost 9 years ago)
- Last Synced: 2023-09-02T04:43:37.335Z (about 1 year ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# csvkeep
Filter a CSV file - only keeping specific columns. Like \*nix `cut` (or SQL `select`) but filters based on named columns.## Usage
```
csvkeep.py [OPTIONS]Options:
--incsv FILENAME input csv
--outcsv FILENAME output csv
--cols TEXT comma separated list of columns to keep
--help Show this message and exit.
```## Assumptions
Assumes the input CSV file has a header.## Example
```
csvkeep.py --incsv /dir/to/infile.csv --outcsv /dir/to/outfile.csv --cols var1,var2,var5
```## Requirements
[click](http://click.pocoo.org) - command line library for Python`pip install click`
## Related
[csvkit](https://github.com/onyxfish/csvkit) - a suite of utilities for converting to and working with CSV