code: public static int columnIndex(CSTable table, String name) {
          for (int i = 1; i <= table.getColumnCount(); i++) {
              if (table.getColumnName(i).equals(name)) {
                  return i;
              }
          }
          return -1;
      }
docs: Gets a column index by name
  
  @param table The table to check
  @param name the column name
  @return the index of the column