Created
December 12, 2017 10:59
-
-
Save hopewise/0373922e51e313a55390114908c31257 to your computer and use it in GitHub Desktop.
Convert a key => value map into a sorted list based on values, works with value if string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enum.map(Enum.to_list(0..Enum.count(Map.keys(row))), fn index -> row["#{index}"] end) | |
example row: | |
row %{"0" => "2", "1" => "أحمد عمر فؤاد خالد عبدالله 2", | |
"10" => "null", "11" => "null", "12" => "null", "13" => "null", | |
"14" => "null", "2" => "Male", "3" => "الأول الأساسي", "4" => "A", | |
"5" => "Amman", "6" => "null", "7" => "null", "8" => "null", "9" => "null"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment