# I want to use two-dimensional array to sort the score by the largest to smallest

**URL:** <https://discourse.processing.org/t/i-want-to-use-two-dimensional-array-to-sort-the-score-by-the-largest-to-smallest/12425>\
**Category:** Coding Questions\
**Created:** [July 1, 2019, 1:31pm UTC](https://discourse.processing.org/t/i-want-to-use-two-dimensional-array-to-sort-the-score-by-the-largest-to-smallest/12425 "2019-07-01T13:31:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![henry](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@henry](https://discourse.processing.org/u/henry)\
**Post date:** [July 1, 2019, 1:31pm UTC](https://discourse.processing.org/t/i-want-to-use-two-dimensional-array-to-sort-the-score-by-the-largest-to-smallest/12425/1 "2019-07-01T13:31:45Z")

</div>

String[]score=loadStrings(“score.csv”);

> **[score](https://docs.google.com/spreadsheets/d/1neOOKFW06Q9J4-7bXuZ_vLjvDTUfXemW9XhhPXJNhX8/edit?usp=sharing)**
>
> score
> 
> studentID,Score
> 101,83
> 102,65
> 103,76
> 104,95
> 105,87
> 106,83
> 107,54
> 108,77
> 109,38
> 110,75
> 111,79
> 112,87
> 113,50
> 114,82
> 115,72
> 116,40
> 117,51
> 118,65
> 119,100
> 120,87
> 121,89
> 122,82
> 123,97
> 124,75
> 125,88
> 126,90
> 127,78
> 128,92
> 129,60
> 130,47
> 131,84
> 132,49
> 13...

  
for (int i=1; i\<score.length; i++) {  
String [][]tokens=split(score[i][], “,”);  
int scores=Integer.parseInt(tokens[i][1]);  
}

//a = sort(a);  
//a=reverse(a);

scores[i][1]=sort(scores[i][1]);  
scores[i][1]=reverse(scores[i][1]);

// and I have to use the returned values to create a new CSV file to save it.

 ![30](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/760a1577cd19a211d456fb76645ff4c70c150cf5.png)

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [July 1, 2019, 1:38pm UTC](https://discourse.processing.org/t/i-want-to-use-two-dimensional-array-to-sort-the-score-by-the-largest-to-smallest/12425/2 "2019-07-01T13:38:17Z")

</div>

[Processing.org/reference/loadTable\_.html](http://Processing.org/reference/loadTable_.html)  
[Processing.org/reference/Table\_sort\_.html](http://Processing.org/reference/Table_sort_.html)

---

<div class="post-metadata">

**Author:** ![henry](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@henry](https://discourse.processing.org/u/henry)\
**Post date:** [July 2, 2019, 6:07am UTC](https://discourse.processing.org/t/i-want-to-use-two-dimensional-array-to-sort-the-score-by-the-largest-to-smallest/12425/3 "2019-07-02T06:07:39Z")

</div>

Thank you GoToLoop! ,i’ll check the link!
