title: Sorting string array by employee id number
body: <p>This is my code:</p>
  <pre><code>BufferedReader reader = new BufferedReader(new FileReader(&quot;Database.txt&quot;));
  ArrayList&lt;String&gt; str = new ArrayList&lt;&gt;();
  String line = &quot;&quot;;
  while((line = reader.readLine()) != null){
      str.add(line);
  }
  reader.close();
  Collections.sort(str);
  FileWriter writer = new FileWriter(&quot;final.txt&quot;);
  for(String s: str){
      writer.write(s);
      writer.write(&quot;\r\n&quot;);
  }
  writer.close();
  FileWriter writers = new FileWriter(&quot;finals.txt&quot;);
  for(String s: str){
      writers.write(s);
      writers.write(&quot;\r\n&quot;);
  }
  writers.close();   
  </code></pre>
  <p>Inputs:</p>
  <pre><code>DADDY,1,GOOD,BAD
  BABY,3,GOOD, BAD
  </code></pre>
  <p>Output using my code:</p>
  <pre><code>BABY,3,GOOD,BAD
  DADDY,1,GOOD,BAD
  </code></pre>
  <p>The array is sorted by <code>names</code> and not by the <code>number</code>.
  I want to sort it using the Number, 1 and 3.</p>
  <p>Expected output:</p>
  <pre><code>DADDY,1,GOOD,BAD
  BABY,3,GOOD, BAD
  </code></pre>
  <p>Is it possible to sort using Number??</p>