public void merger()
    {
        String line1="", line2="";
        BufferedReader reader1=null, reader2=null;
        String content="";
        File output =null;
        String prevline1="",prevline2="";
        try {
            reader1 = new BufferedReader(new InputStreamReader(new FileInputStream(file1name+"\\ValueSum.dat")));
            reader2 = new BufferedReader(new InputStreamReader(new FileInputStream(file2name+"\\ValueSum.dat")));
            File directory = new File("compare Algorithm");

            if(!directory.exists())
            {
                directory.mkdir();;
            }
            
            output = new File("compare Algorithm\\comparedata.dat");
            File output2 =  new File("compare Algorithm\\compareval.jpeg");
            File ouput3 = new File("compare Algorithm\\comapre_Script.gnu");
            if(output.exists()){
                output.delete();;
            }
            output.createNewFile();
            int count=0;
            
            while ((((line1 = reader1.readLine()) != null) | ((line2 = reader2.readLine()) != null))&&count<15)
            {
                if(line1 == null ){
                    content+=prevline1+" ";
                    count++;
                }
                else{
                    content+=line1+" ";
                    prevline1 =  line1;
                }
                if(line2 ==  null){
                    content+=prevline2+"\n";
                    count++;
                }
                else{
                    content+=line2;
                    prevline2 =line2;
                    content+="\n";
                }
            }
            FileWriter fw = new FileWriter(output.getAbsoluteFile());
            BufferedWriter bw = new BufferedWriter(fw);
            bw.write(content);
            bw.close();

        } catch (FileNotFoundException ex) {
            Logger.getLogger(FileMerger.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(FileMerger.class.getName()).log(Level.SEVERE, null, ex);
        }
       
        
    }