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("")) {
                if (tempString.contains("U")) //invalid characters
                            "Invalid sequence Character.",
                mainString = mainString.concat(tempString);

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

6 Years
Discussion Span
Last Post by Taywin

1)Please use "code" tag next time.
2)How do you define "compute the edit distance between these two files"? What does this mean? Could you give an example?
3)How big each file is? Are you sure that an array size of 3000 would be able to hold all cases?

Edited by Taywin: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.