Code+used+here+(102112)

import java.io.BufferedReader; import java.io.DataInputStream; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.ArrayList;

public class LargeTextFileHandler {

private String full_text_file_filepath = ""; private String output_folder = ""; private UsefulTools useful_tools = new UsefulTools;

/** public static void main(String[] args) { //TODO Auto-generated method stub LargeTextFileHandler lfh = new LargeTextFileHandler; lfh.test1;
 * @param args

}

public void test1 { String log_directory = "S:\\Research\\Cancer_Eradication\\Users\\kwhittem\\DR\\2012\\9-28-12\\mpa\\blast\\blast_results"; String log_filename = "log_"+useful_tools.getFilenameTime+".txt"; useful_tools.createTextFile(log_directory, log_filename, "Start time: " +useful_tools.getTime+"\r"); setTextFile("S:\\Research\\Cancer_Eradication\\Users\\kwhittem\\DR\\2012\\9-28-12\\mpa\\blast\\blast_results\\table_of_blast_results.txt"); setOutputFolder("S:\\Research\\Cancer_Eradication\\Users\\kwhittem\\DR\\2012\\9-28-12\\mpa\\blast\\blast_results\\ltfh"); for(int i=6011; i<8000; i++) { if(!findLinesContaining("0_"+i+"i_b_1_2i")) { useful_tools.appendTextFile(log_directory, log_filename, "No item was found for "+i+"\r");

} } for(int i=18001; i<20000; i++) { if(!findLinesContaining("0_"+i+"i_b_1_2i")) { useful_tools.appendTextFile(log_directory, log_filename, "No item was found for "+i+"\r");

} } useful_tools.appendTextFile(log_directory, log_filename, "End time: " + useful_tools.getTime); }

public void setTextFile(String full_text_file_filepath) { this.full_text_file_filepath = full_text_file_filepath; }

public void setOutputFolder(String output_folder) { this.output_folder = output_folder; }

public boolean findLinesContaining(String regex) { boolean at_least_one_item_found = false; String file_name = "findLines_"+useful_tools.getFilenameTime+".txt"; useful_tools.createTextFile(output_folder, file_name, "");

useful_tools.appendTextFile(output_folder, file_name, "Start time: "+useful_tools.getTime+"\r"); try{ FileInputStream fstream = new FileInputStream(full_text_file_filepath);// Get the object of DataInputStream DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine; //Read File Line By Line while ((strLine = br.readLine) != null) { if(useful_tools.isMatchofRegEx(strLine, regex)) { at_least_one_item_found = true; useful_tools.appendTextFile(output_folder, file_name, strLine+"\r"); } }// Close the input stream in.close; }catch (Exception e){//Catch exception if any System.err.println("Error: " + e.getMessage); } useful_tools.appendTextFile(output_folder, file_name, "End time: "+useful_tools.getTime); return at_least_one_item_found; } }