private String cleanup(String col){
  int idx=col.indexOf(" ");
  if (idx > 0)   return col.substring(0,idx);
 else   return col;
}

private String cleanup ( String col ) { int idx = col . indexOf ( " " ) ; if ( idx > 0 ) return col . substring ( 0 , idx ) ; else return col ; }
removes trailing spaces and comments from a column .
