title: Formatting the output in desired way
body: <p>the following method produces an output.
  The only problem with this code is that after the end of report, it adds two extra lines to the file, while the need is only of one empty line.
  i have tried various combinations but uanble to proceed.</p>
  
  <p>Can anybody help here?</p>
  
  <pre><code>private static void save_player_info(String[][] data, String player) {
      player=player.toLowerCase();
      try {
          PrintWriter printWriter= new PrintWriter(new File("out4.txt"));
          for(int row=1;row&lt;data.length;row++){
              String playerName=data[row][0].toLowerCase();
              if(playerName.indexOf(player)!=-1){
                  String[] fields=data[0];
                  String[] values=data[row];
                  for (int i=0;i&lt;fields.length;i++){
                      printWriter.printf("%21s : %s\n",fields[i],values[i]);
                  }
  
                  printWriter.print("\n");
  
              }
          }
  
          printWriter.close();
  
      } catch (FileNotFoundException e) {
          e.printStackTrace();
      }
  
  }
  </code></pre>
  
  <p>}</p>