val = removeTrailingPeriod(val);
  private void readHeader(StreamTokenizer tokenizer) throws IOException {    FastVector attribDefs = new FastVector();    FastVector ignores = new FastVector();    ConverterUtils.getFirstToken(tokenizer);    if (tokenizer.ttype == StreamTokenizer.TT_EOF) {      ConverterUtils.errms(tokenizer,"premature end of file");    }    m_numAttribs = 1;    // Read the class values    FastVector classVals = new FastVector();    while (tokenizer.ttype != StreamTokenizer.TT_EOL) {      String val = tokenizer.sval.trim();      if (val.length() > 0) {	classVals.addElement(val);      }      ConverterUtils.getToken(tokenizer);    }    // read the attribute names and types    int counter = 0;    while (tokenizer.ttype != StreamTokenizer.TT_EOF) {      ConverterUtils.getFirstToken(tokenizer);      if (tokenizer.ttype != StreamTokenizer.TT_EOF) {	String attribName = tokenizer.sval;	ConverterUtils.getToken(tokenizer);	if (tokenizer.ttype == StreamTokenizer.TT_EOL) {	  ConverterUtils.errms(tokenizer, "premature end of line. Expected "			       +"attribute type.");	}	String temp = tokenizer.sval.toLowerCase().trim();	if (temp.startsWith("ignore") || temp.startsWith("label")) {	  ignores.addElement(new Integer(counter));	  counter++;	} else if (temp.startsWith("continuous")) {	  attribDefs.addElement(new Attribute(attribName));	  counter++;	} else {	  counter++;	  // read the values of the attribute	  FastVector attribVals = new FastVector();	  while (tokenizer.ttype != StreamTokenizer.TT_EOL &&		 tokenizer.ttype != StreamTokenizer.TT_EOF) {	    String val = tokenizer.sval.trim();	    if (val.length() > 0) {	      attribVals.addElement(val);	    }	    ConverterUtils.getToken(tokenizer);	  }	  attribDefs.addElement(new Attribute(attribName, attribVals));	}      }    }    boolean ok = true;    int i = -1;    if (classVals.size() == 1) {      // look to see if this is an attribute name (ala c5 names file style)      for (i = 0; i < attribDefs.size(); i++) {	if (((Attribute)attribDefs.elementAt(i))	    .name().compareTo((String)classVals.elementAt(0)) == 0) {	  ok = false;	  m_numAttribs--;	  break;	}      }    }    if (ok) {      attribDefs.addElement(new Attribute("Class", classVals));    }    m_structure = new Instances(m_fileStem, attribDefs, 0);    try {      if (ok) {	m_structure.setClassIndex(m_structure.numAttributes()-1);      } else {	m_structure.setClassIndex(i);      }    } catch (Exception ex) {      ex.printStackTrace();    }    m_numAttribs = m_structure.numAttributes() + ignores.size();    m_ignore = new boolean[m_numAttribs];    for (i = 0; i < ignores.size(); i++) {      m_ignore[((Integer)ignores.elementAt(i)).intValue()] = true;    }  }