BurntSushi / xsv

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

Feature request: `xsv table` without fully buffered data. #274

Open vi opened 3 years ago

vi commented 3 years ago

I expect it to analyse e.g. 1000 first rows, calculate row widths, then just use those widths for the rest of the data without, even if some of fields exceed the width.

AntonHermann commented 2 years ago

I was thinking about a similar thing and I think it should be doable, I was thinking about a new flag --streaming. If this flag is passed, the wtr.flush() in src/cmd/table.rs:69 is executed inside the loop instead of after it, thus outputting a table row every input row.

This however I haven't tested yet, will try to do that the next days.

On the other hand, this repository seems to be on ice at the moment, see #267 There is a fork however that seems to be more actively maintained: qsv so maybe I will try to submit these changes over there :)

jqnatividad commented 2 years ago

Hi @AntonHermann, I'm the maintainer of the qsv fork and I too would like to see this feature and look forward to your PR!