Sort slices of strings based on multiple indices or column
Reverse sort is possible by providing negative index
values or prefixing column header titles with
Note that indices are not zero based, but start with 1.
If an index is out of range, an empty string will be
used for comparing, rather than throwing a runtime
Normally you only need to use this function:
or these two together:
NewHeaders(titles) ByHeaders(headers, rows, titles)
Only if you need to sort the same rows multiple times
in different orders, you'll need to use the
This was developed with the xlsx package in mind, but can be used independently.
See godoc for more documentation and examples.
Released under the MIT License.