summaryrefslogtreecommitdiffstats
path: root/src/main.rs
AgeCommit message (Collapse)Author
2018-10-02xsv: fix error message for invalid commandsmintyplanet
Fixes #138
2018-08-25deps: use crossbeam-channel instead of chanAndrew Gallant
This also drops an ancient rand 0.3 dependency.
2018-08-22xsv: add reverse commandDimagog
reverse command to reverse rows of CSV data. Unlike sort command, it preserves order of rows with the same key. PR #134
2018-07-24xsv: add `partition` to command listAlexandre Bury
The `xsv partition` has been available for some time, but is not visible in the help message or in `xsv --list`. PR #131
2018-03-22deps: update all dependenciesAndrew Gallant
This includes the update to docopt 0.8, which moves us over to Serde. Woohoo! We also bump the minimum Rust version supported to 1.20.0.
2017-05-24small performance improvements0.12.1Andrew Gallant
For the most part, this switches write_record to write_byte_record where possible, and also moves some uses of the `byte_records` iterator to the manual `read_byte_record` method, which permits us to amortize allocation. This also removes the use of normal selection for `xsv search`, which was causing a huge slow down. Also, bump to csv 1.0.0.beta.3.
2017-05-23Migrate to csv crate rewrite.0.12.0Andrew Gallant
This commit resists the urge to refactor/rewrite xsv and ports it over to the new CSV API. It made a lot of things cleaner and even improved the performance of core commands like `count`, `sample`, `search`, `select` and `slice`. This also removes the last remaining (dubious) uses of `unsafe` within xsv. Benchmarks before/after: benchmark before after count 0.26s 175.05 MB/sec 0.11 413.76 MB/sec flatten 4.53s 10.04 MB/sec 4.54 10.02 MB/sec flatten_condensed 4.72s 9.64 MB/sec 4.45 10.22 MB/sec frequency 1.91s 23.82 MB/sec 1.82 25.00 MB/sec index 0.28s 162.54 MB/sec 0.12 379.28 MB/sec sample_10 0.43s 105.84 MB/sec 0.18 252.85 MB/sec sample_1000 0.44s 103.44 MB/sec 0.18 252.85 MB/sec sample_100000 0.50s 91.02 MB/sec 0.29 156.94 MB/sec search 0.59s 77.14 MB/sec 0.27 168.56 MB/sec select 0.41s 111.00 MB/sec 0.14 325.09 MB/sec sort 2.59s 17.57 MB/sec 2.18 20.87 MB/sec slice_one_middle 0.22s 206.88 MB/sec 0.08 568.92 MB/sec slice_one_middle_index 0.01s 4551.36 MB/sec 0.01 4551.36 MB/sec stats 1.26s 36.12 MB/sec 1.09 41.75 MB/sec stats_index 0.19s 239.54 MB/sec 0.15 303.42 MB/sec stats_everything 2.13s 21.36 MB/sec 1.94 23.46 MB/sec stats_everything_index 1.00s 45.51 MB/sec 0.93 48.93 MB/sec
2017-03-25Add `xsv partition` to partition on a column's valuesEric Kidd
This patch adds a new `xsv partition` subcommand, and makes a few minor modifications to `xsv split` for consistency. The new subcommand is used as follows: xsv partition state out/ cities.csv This will take the data in `cities.csv` and use the `state` column to create new file names, creating files like: out/CA.csv out/TX.csv If the `states` column is empty, we'll put the data into: out/empty.csv There's an option for specifying the filename template: xsv partition --filename=state-{}.csv state out/ cities.csv This will create: out/state-CA.csv out/state-TX.csv This `--filename` option may also be used for `xsv split`. There's also a `--prefix-length` argument, which can be used to limit the number of files created: xsv partition --prefix-length=3 zip out/ customers.csv This will create files using the first three digits of the zip code: out/000.csv out/010.csv out/011.csv out/213.csv Note that if you try to split into more than roughly 500 files on Windows or 1000 files on Linux systems, you may need to adjust `ulimit` or the local equivalent. (This was discussed in the original proposal.) You can also write `--filename={}/file.csv`. This supports two use cases: xsv partition --filename {}/cities.csv state . all-cities.csv xsv partition --filename {}/monuments.csv state . all-monuments.csv xsv partition --filename {}/parks.csv state . all-parks.csv Above, we want to partition our records by state into separate directories, but we have multiple kinds of data. xsv partition --filename {}/$(uuidgen).csv . input1.csv xsv partition --filename {}/$(uuidgen).csv . input2.csv Above, we're running multiple (possibly parallel) copies of xsv and we want to parition the data into multiple directories without a filename clash. Fixes #51.
2017-03-24Add help message for "<command> -h"Damien
2016-07-31update deps and some rustupAndrew Gallant
This in particular updates to the latest packages available and fixes a few visibility warnings produced by rustc (that will eventually become hard errors).
2016-01-21fix a few warnings from rustc+clippyllogiq
2015-11-14Just use the num_cpus crate instead of rolling our own.Andrew Gallant
Fixes #26.
2015-08-30Remove * deps and move to Rust stable for tests.Andrew Gallant
2015-07-12Switch to use `chan` crate.Andrew Gallant
There's no particular advantage in these simplistic cases, but dogfooding is A Good Thing.
2015-07-04Compile on Rust stable 1.1.Andrew Gallant
We still can't run tests on stable (because we need to be able to set file times), but that's fine for now.
2015-05-16More rustupping.Andrew Gallant
Essentially, use the new `filetime` crate to do stuff with last modified/accessed file times.
2015-04-03rustup.Andrew Gallant
Not quite on Rust stable yet, but close.
2015-03-30Add input/output support for quoting.Andrew Gallant
2015-03-30Move `mod` definitions to the top.Andrew Gallant
2015-03-28rustupAndrew Gallant
2015-03-23Fix #7.Andrew Gallant
2015-03-21rustupAndrew Gallant
2015-03-19rustupAndrew Gallant
2015-03-16rustupAndrew Gallant
2015-03-15rustupAndrew Gallant
2015-03-12rustupAndrew Gallant
2015-03-08Show command list on stdout.Andrew Gallant
Also, benchmarks seem OK... no major regressions. Weird.
2015-03-08rustupAndrew Gallant
2015-03-07Migrate to std::io.Andrew Gallant
We seem to have suffered some major perf regressions. Ug.
2015-03-01rustup + cleanupAndrew Gallant
Basically reducing the number of unstable features being used.
2015-02-26rustupAndrew Gallant
2015-02-20rustupAndrew Gallant
2015-02-12rustupAndrew Gallant
2015-02-05rustupAndrew Gallant
2015-01-30rustupAndrew Gallant
2015-01-28rustupAndrew Gallant
2015-01-23rustupAndrew Gallant
2015-01-20rustupAndrew Gallant
2015-01-09Use deref instead of as_sliceAndrew Gallant
2015-01-09rustupAndrew Gallant
2015-01-07rustupAndrew Gallant
2015-01-06rustupAndrew Gallant
2015-01-04rustupAndrew Gallant
2014-12-25rustup on tests and other various odds and ends.Andrew Gallant
2014-12-25rustupAndrew Gallant
2014-12-20rust and dependency upAndrew Gallant
2014-12-07\o/ if_let and tuple_indexing are part of the language now.Andrew Gallant
2014-12-02Add support for `--list` flag.Andrew Gallant
This makes it work better with tab completion.
2014-12-02Fallout from namespaced enum variants.Andrew Gallant
2014-11-26Use a `fail!` macro, which is just `Err(FromError::from_error(...))`.Andrew Gallant