title: sort values column CSV java
body: <p>I'm trying to sort descending the following CSV based on the values contained in three columns(url,priority,length), in the same way that the <code>order by</code> in the SQL language was executed</p>
  
  <p>The starting CSV is the following:</p>
  
  <pre><code>url;review;priority;length
  1610-bagel-torino;"Ingredienti di qualità.";0;15
  1610-bagel-torino;"Il personale è molto gentile.";1;7
  7-nani-torino;"Farina buonissima.";0;14
  1610-bagel-torino;"Posto carino.";0;9
  7-nani-torino;"Arredamento semplice.";1;9
  </code></pre>
  
  <p>And i want to obtain</p>
  
  <pre><code>url;review;priority;length
  7-nani-torino;"Arredamento semplice.";1;9
  7-nani-torino;"Farina buonissima.";0;14
  1610-bagel-torino;"Il personale è molto gentile.";1;7
  1610-bagel-torino;"Ingredienti di qualità.";0;15
  1610-bagel-torino;"Posto carino.";0;9
  </code></pre>
  
  <p>I started with this code but sorting descending only based on the URL and priority columns.</p>
  
  <pre><code>ArrayList&lt;String&gt; list = new ArrayList&lt;&gt;();
  BufferedReader br = new BufferedReader(new FileReader("contexts_file/matching/lessico_frasi/"+context+"_ranking.csv"));
  String line = "";
  while ((line = br.readLine()) != null) {
           String[] arr = line.split(";");
           list.add(arr[0]+","+arr[2]+","+arr[3]);
        }
  Collections.sort(list);
  Collections.reverse(list);
  list.forEach(i -&gt; System.out.println(i));
  </code></pre>
  
  <p>With this code the output is the following:</p>
  
  <pre><code>url;review;priority;length
  7-nani-torino;"Arredamento semplice.";1;9
  7-nani-torino;"Farina buonissima.";0;14
  1610-bagel-torino;"Il personale è molto gentile.";1;7
  1610-bagel-torino;"Posto carino.";0;9
  1610-bagel-torino;"Ingredienti di qualità.";0;15
  </code></pre>
  
  <p>The last two lines should be reversed</p>