code: public static Set<String> readColumnSet(String infile, int field) throws IOException
    {
      BufferedReader br = IOUtils.getBufferedFileReader(infile);
      String line;
      Set<String> set = new HashSet<String>();
      while ((line = br.readLine()) != null) {
        line = line.trim();
        if (line.length() > 0) {
          if (field < 0) {
            set.add(line);
          } else {
            String[] fields = tab.split(line);
            if (field < fields.length) {
              set.add(fields[field]);
            }
          }
        }
      }
      br.close();
      return set;
    }
docs: Read column as set
  @param infile - filename
  @param field  index of field to read
  @return a set of the entries in column field
  @throws IOException