private static String[] selectColumnNames(List<String> names,ColumnType types[]){
  List<String> header=new ArrayList<>();
  for (int i=0; i < types.length; i++) {
    if (types[i] != ColumnType.SKIP) {
      header.add(names.get(i));
    }
  }
  String[] result=new String[header.size()];
  return header.toArray(result);
}

private static String [ ] selectColumnNames ( List < String > names , ColumnType types [ ] ) { List < String > header = new ArrayList < > ( ) ; for ( int i = 0 ; i < types . length ; i ++ ) { if ( types [ i ] != ColumnType . SKIP ) { header . add ( names . get ( i ) ) ; } } String [ ] result = new String [ header . size ( ) ] ; return header . toArray ( result ) ; }
reads column names from header , skipping any for which the type = = skip
