I have a multi-dimensional array where 1 of the levels has integers and I would like to sort this level numerically. I thought one could do this placing a certain value in the 3rd subscript of asorti. Is that true? If so, what is the value?
Thanks, Steve
On 10/25/2021 11:26 AM, solitary....@gmail.com wrote:
I have a multi-dimensional array where 1 of the levels has integers and I would like to sort this level numerically. I thought one could do this placing a certain value in the 3rd subscript of asorti. Is that true? If so, what is the value?
Thanks, Steve
Yes, see https://www.gnu.org/software/gawk/manual/gawk.html#Controlling-Scanning.
See also
https://www.gnu.org/software/gawk/manual/gawk.html#Array-Sorting as you
may not need asorti() depending on what you're going to do with the result.
Note that asorti() is a GNU awk extension.
Ed.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 292 |
Nodes: | 16 (2 / 14) |
Uptime: | 179:57:20 |
Calls: | 6,616 |
Calls today: | 3 |
Files: | 12,165 |
Messages: | 5,314,120 |