-
Problem:
By default, aq.fromCSV(csv, { header: false }).orderby('col1').toCSV()
Correct order would be:
One can achieve that by using (lhs, rhs) => lhs.localeCompare(rhs, 'tr-TR'); Is there a way to feed this comparator to the Arquero somehow? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There is not a mechanism for this at present. Currently Arquero relies on standard JS comparison operators. I'll open a feature request issue for this. |
Beta Was this translation helpful? Give feedback.
-
Arquero version 7.1.0 now includes a aq.fromCSV(csv, { header: false }).orderby(aq.collate('col1', 'tr-TR')).toCSV() The collate method accepts either arguments compatible with the Intl.Collator constructor (such as a locale string) or a two-argument custom comparator function. |
Beta Was this translation helpful? Give feedback.
Arquero version 7.1.0 now includes a
collate
helper function to support custom string orders. You can use it in your example above like so:The collate method accepts either arguments compatible with the Intl.Collator constructor (such as a locale string) or a two-argument custom comparator function.