import java.io.*; import java.util.*; import java.lang.*; import java.util.regex.Matcher; import java.util.regex.Pattern; public class MAIN { /* this function is used to compare string values from two * separate text files. */ public static void main(String[] args) { /* arraylists and hashsets */ ArrayList registry_ratios = new ArrayList(); ArrayList registry_uniques = new ArrayList(); ArrayList registry_studies = new ArrayList(); ArrayList results_ratios = new ArrayList(); ArrayList results_studies = new ArrayList(); ArrayList formularies = new ArrayList(); ArrayList removal = new ArrayList(); Set temp = new HashSet(); HashMap results_uniques = new HashMap(); try { BufferedReader in_one = new BufferedReader(new FileReader("registry.txt")); BufferedReader in_two = new BufferedReader(new FileReader("formularies.txt")); String registry_line; String formularies_line; /* separate each line, convert to uppercase and add to the arraylist */ while ((registry_line = in_one.readLine()) != null) { registry_line = registry_line.toUpperCase(); registry_ratios.add(registry_line); } while ((formularies_line = in_two.readLine()) != null) { formularies_line = formularies_line.toUpperCase(); temp.add(formularies_line); } /* put the formularies back into an arraylist */ for(Iterator it = temp.iterator(); it.hasNext(); ) { formularies.add(it.next()); } /* we don't need the bufferedreader open anymore */ in_one.close(); in_two.close(); } catch (IOException e) { } /* now do our comparisons */ String regexp = null; Pattern pattern = null; Matcher matcher = null; for(int x=0;x