BurntSushi / xsv

A fast CSV command line toolkit written in Rust.
The Unlicense
10.38k stars 323 forks source link

Feature request: headers --just-indices #205

Closed jplatte closed 4 years ago

jplatte commented 4 years ago

There is already -j, --just-names, so why not --just-indices too? They are more robust, e.g. I'm currently working with file that have - in their header names, which I can't pass to xsv select as-is.

BurntSushi commented 4 years ago

Why not? Probably because nobody has asked for it, and it's a pretty small thing that is easily worked around.

A PR would be welcome for this.

jplatte commented 4 years ago

Actually I just realized, not even my initial use case (that I've now replaced with a full-blown Rust program, using the csv crate of course) would have been enabled by this. I wanted to get indices for headers whose names I filtered with grep. xsv | grep | xsv or xsv | grep | awk makes sense here, this option wouldn't enable that, because the filtering step would't be possible.

Sorry for the low-effort feature request.