Java BufferedReader Read loadBussinessGroupCompanies(String file_path)

Here you can find the source of loadBussinessGroupCompanies(String file_path)

Description

load Bussiness Group Companies

License

Open Source License

Declaration

public static HashSet<String> loadBussinessGroupCompanies(String file_path) throws Exception 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;
import java.util.*;

public class Main {
    public static HashSet<String> loadBussinessGroupCompanies(String file_path) throws Exception {
        FileInputStream fi = new FileInputStream(file_path);
        InputStreamReader in = new InputStreamReader(fi, "big5");
        BufferedReader br = new BufferedReader(in);
        HashSet<String> result = new HashSet<String>();

        String s = null;//from  w  w  w.  j  a v  a  2  s.  c o m
        while ((s = br.readLine()) != null) {
            s = s.substring(s.indexOf(":") + 1, s.length());
            String[] tokens = s.split(",");
            int i = 0;
            while (i < tokens.length) {
                if (result.contains(tokens[i])) {
                    System.out.println(tokens[i]);
                }
                result.add(tokens[i]);
                i++;
            }
        }
        in.close();
        fi.close();
        return result;
    }
}

Related

  1. loadAFileToString2(File f)
  2. loadAPIKey(InputStream in)
  3. loadAuthFile(String fileName)
  4. loadBase64Object(BufferedReader rdr, String type)
  5. loadBlackList(String blackListPath)
  6. loadByUsingSplit(String filename)
  7. loadClob(File f, String enc)
  8. loadCommonMisspellingsFile(String commonMisspellingsFileLocation)
  9. loadConfFile(String filename, String key)