code: public static int [] createRemapTable(String [] controlFields, String [] remappedFields) {
          // create hash map with remapped fields
          HashMap<String,Integer> map = new HashMap<String, Integer>();
          for (int index = 0; index < remappedFields.length; index++) {
              String field = remappedFields[index];
              map.put(field, index);
          }
  
          // create remap table
          int remap [] = new int[controlFields.length];
  
          for (int index = 0; index < controlFields.length; index++) {
              Integer remapIndex = map.get(controlFields[index]);
              if(remapIndex == null) {
                  // no match
                  remapIndex = -1;
              }
              remap[index] = remapIndex;
          }
  
          return remap;
      }
docs: This method creates a field remap table. This is useful for CSV/TSV type files where you have to similar headers
  and you need to map from one format to the other. Control fields is the desired format, remapped fields is the
  format that you need to convert from. The remap table will contain -1 for unmappable fields
  
  The resulting remap table can then be used like this:
  
  int [] remap = createRemapTable(newHeaders, oldHeaders);
  for(int i=0; newArray.length ; i++) {
  if(remap[i] != -1) {
  newArray[i] = oldArray[remap[i]]
  }
  }
  
  @param controlFields string field array representing the new header format
  @param remappedFields string field array representing the old header format
  @return int array with a remap table