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);

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.