title: Weka ArffSaver Not Writing Data
body: <p>I am attempting to replicate the csv to arff instructions found <a href="http://weka.wikispaces.com/Converting+CSV+to+ARFF" rel="nofollow">here</a>. My code is copied below. The resultant arff prints the attributes section correctly. However, there is nothing under the "@data" section:</p>
  
  <p>Code:</p>
  
  <pre><code>public class CsvToArff {
    /**
     * takes 2 arguments:
     * - CSV input file
     * - ARFF output file
     */
    public static void main(String[] args) throws Exception {
      if (args.length != 2) {
        System.out.println("\nUsage: CSV2Arff &lt;input.csv&gt; &lt;output.arff&gt;\n");
        System.exit(1);
      }
  
      // load CSV
      CSVLoader loader = new CSVLoader();
      loader.setFieldSeparator(";");
      loader.setNominalAttributes("2,5,8,10");
      loader.setNoHeaderRowPresent(false);
      loader.setSource(new File(args[0]));
      loader.getStructure();
      Instances data = loader.getDataSet();
  
      // save ARFF
      ArffSaver saver = new ArffSaver();
      saver.setInstances(data);
      saver.setFile(new File(args[1]));
      saver.setDestination(new File(args[1]));
      saver.writeBatch();
    }
  }
  </code></pre>
  
  <p>CSV File:  </p>
  
  <pre><code>PrevPause;PrevPOS;PrevLength;WordPause;WordPOS;WordLength;NextPause;NextPOS;NextLength;Location
  625;"JJ";4;156;"NN";4;1234;"FW";1;"OUT"
  156;"NN";4;1234;"FW";1;187;"NN";4;"OUT"
  1234;"FW";1;187;"NN";4;188;"VBD";3;"OUT"
  </code></pre>
  
  <p>Resultant arff:</p>
  
  <pre><code>@relation mwe_pred_debug
  
  @attribute PrevPause numeric
  @attribute PrevPOS {JJ,NN,FW}
  @attribute PrevLength numeric
  @attribute WordPause numeric
  @attribute WordPOS {NN,FW}
  @attribute WordLength numeric
  @attribute NextPause numeric
  @attribute NextPOS {FW,NN,VBD}
  @attribute NextLength numeric
  @attribute Location {OUT}
  
  @data
  </code></pre>
  
  <p>Any idea why the last section is blank?</p>