Replies: 2 comments 4 replies
-
@johnkerl is there a way to apply "natural sorting"? If I have
I can run
It would be great to have natural sort option both in sort verb and in DSL array function. |
Beta Was this translation helpful? Give feedback.
-
@aborruso if I understand correctly there are two separate questions here. First issueThe first is how to sort within a field -- https://miller.readthedocs.io/en/latest/sorting/#custom-sorting-of-arrays-within-records is indeed the right place -- perhaps it could be more clear. The examples there I showed were multi-line, but you could also do this on one line like this:
That is, I think, much simpler than Second issueThe second issue is how to specify the rule by which Miller does its sorting. To be honest, I'm embarrassed to admit that this is the first I've heard of "natural sort order" -- I had to google it just now. Miller absolutely does not (yet) do this. However, now that I know about it, I like it very much and it should be Miller's default. It looks like there are good resources for this & it should be pretty quick to code up. Thanks for teaching me about this! :) |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have this CSV
and I would like to order the arrays in
b
to obtainThese arrays are both text and number. And to do it I run this command:
Now I know that in Miller 6 we have arrays and we have the great DSL. And I would like to learn how to do it using array functions.
I have read this documentation page, but I'm not able to create a right script.
I would apply
regextract
function in a sorting for loop.Do you have some tips for me?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions