hi , i am new to programming in java , i developed a program in java , my program is take two input files , first file has one sequence and second file has multiple sequences and then compute the edit distance between these two files . my problem is i want to compute or count the length of characters in file 1 here is my code plz help me ....
BufferedReader in1, in2;
try {
in1 = new BufferedReader(new FileReader(file1));
in2 = new BufferedReader(new FileReader(file2));
Integer output_result[] = new Integer[3000];
String output_squence[] = new String[3000];
String s2 = "";
Integer result;
Integer index = 0;
BufferedWriter out = new BufferedWriter(new FileWriter("D:\\output.txt"));
String mainString = in1.readLine();
String tempString = "";
boolean flag = (mainString.substring(0, 1)).equals(">");
if (flag == true) {
mainString = "";
while ((tempString = in1.readLine()) != null) {
if (tempString.equals("")) {
break;
}
if (tempString.contains("U")) //invalid characters
{
JOptionPane.showMessageDialog(this,
"Invalid sequence Character.",
"Error",
JOptionPane.ERROR_MESSAGE);
break;
}
mainString = mainString.concat(tempString);