csv-sort-cli2.0.1
Call on a file
Call csvsort
(or sortcsv
) appending your file name (with or without -o
/--overwrite
flag):
$ csvsort YOURFILE.csv
$ csvsort -o YOURFILE.csv
$ csvsort --overwrite YOURFILE.csv
$ csvsort -v
$ csvsort --version
$ csvsort -h
$ csvsort --help
like this:

Or omit the file's name
It will let you pick a CSV:
$ csvsort # omit the file's name, but you can include -o/--overwrite flag
omit the file name and csv-sort-cli
will offer a list of CSV files in the current folder to choose from:

You can even try it without installing — use npx
:
$ npx csv-sort-cli YOURFILE.csv
What it does exactly
- It sorts CSV file rows to correspond to the double-entry bookkeeping principles:

Sometimes internet banking CSV's have rows in a wrong order, especially when entries are on the same date. This library helps to sort the rows in correct order.
- As a bonus, it will trim the empty columns/rows:

- Not to mention, the our custom CSV parser
csv-split-easy
used here will ensure that all CSV cell contents are trimmed, and there are no empty rows between the content rows. It also accepts any commas as content if the cell is wrapped with a double quotes.
Changelog
See it in the monorepo , on GitHub.
Contributing
To report bugs or request features or assistance, raise an issue on GitHub .
Any code contributions welcome! All Pull Requests will be dealt promptly.
Licence
Copyright © 2010–2021 Roy Revelt and other contributors