I want to compare two properties files line by line and want to generate output.txt file with Modified, Deleted properties separately
<p>This this code i used to generate,i am getting output file with combination of modified and deleted properties but i need them separately.
basically output like</p>

<p>Modified properties</p>

<p>"original property" - "modified property"</p>

<p>Deleted propertied</p>

<p>"Property"</p>

<p>please help me out from this</p>

<pre><code>import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.Set;


    public class FC {

        private Properties prop1 = null;
        private Properties prop2 = null;
        private Properties prop3 = null;
        private Properties prop4 = null;

        public FC(){

            InputStream is1 = null;
            InputStream is2 = null;
            InputStream is3 = null;
            InputStream is4 = null;

            try {
                this.prop1 = new Properties();
                is1 = new FileInputStream("C:\\new\\pranu.properties");
                prop1.load(is1);

                this.prop2 = new Properties();
                is2 = new FileInputStream("C:\\prop\\pranu1.properties");
                prop2.load(is2);


                this.prop3 = new Properties();
                is3 = new FileInputStream("C:\\new\\pranu3.properties");
                prop3.load(is3);

                this.prop4 = new Properties();
                is4 = new FileInputStream("C:\\prop\\pranu4.properties");
                prop4.load(is4);
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        public Set&lt;Object&gt; getAllKeysProp1(){
            Set&lt;Object&gt; keys = prop1.keySet();
            return keys;
        }  

        public Set&lt;Object&gt; getAllKeysProp2(){
            Set&lt;Object&gt; keys = prop2.keySet();
            return keys;

        }

        public Set&lt;Object&gt; getAllKeysProp3(){
            Set&lt;Object&gt; keys = prop3.keySet();
            return keys;
        }

        public Set&lt;Object&gt; getAllKeysProp4(){
            Set&lt;Object&gt; keys = prop4.keySet();
            return keys;
        }

        public static void main(String a[]){
            FC mpc = new FC();

            List&lt;String&gt; a1 = new ArrayList&lt;String&gt;();
            List&lt;String&gt; a2 = new ArrayList&lt;String&gt;();
            List&lt;String&gt; a3 = new ArrayList&lt;String&gt;();
            List&lt;String&gt; a4 = new ArrayList&lt;String&gt;();

            Set&lt;Object&gt; keys = mpc.getAllKeysProp1();
            for(Object k:keys){
                String key = (String)k;
                a1.add(key);
            }

            Set&lt;Object&gt; keys2 = mpc.getAllKeysProp2();
            for(Object k:keys2){
                String key = (String)k;
                a2.add(key);
            }

            a2.removeAll(a1);

            Set&lt;Object&gt; keys3 = mpc.getAllKeysProp1();
            for(Object k:keys3){
                String key = (String)k;
                a3.add(key);
            }

           Set&lt;Object&gt; keys4 = mpc.getAllKeysProp2();
                for(Object k:keys4){
                    String key = (String)k;
                    a4.add(key);   

            }

            a3.removeAll(a4);

            a2.addAll(a3);

            List&lt;String&gt; a5 = new ArrayList&lt;String&gt;();
            List&lt;String&gt; a6 = new ArrayList&lt;String&gt;();
            List&lt;String&gt; a7 = new ArrayList&lt;String&gt;();
            List&lt;String&gt; a8 = new ArrayList&lt;String&gt;();

            Set&lt;Object&gt; keys5 = mpc.getAllKeysProp3();
            for(Object k:keys5){
                String key = (String)k;
                a5.add(key);

            }    

            Set&lt;Object&gt; keys6 = mpc.getAllKeysProp4();
            for(Object k:keys6){
                String key = (String)k;
                a6.add(key);   
            }

            a6.removeAll(a5);

            Set&lt;Object&gt; keys7 = mpc.getAllKeysProp3();
            for(Object k:keys7){
                String key = (String)k;
                a7.add(key);   
            }

            Set&lt;Object&gt; keys8 = mpc.getAllKeysProp4();
            for(Object k:keys8){
                String key = (String)k;
                a8.add(key);
            }

            a7.removeAll(a8);

            a7.addAll(a6);

            System.out.println(a2+"\n"+a7);
            System.out.println("Comparision Report generated in C Drive under Props folder");



      //create a file first    
        try {
            PrintStream outputfile = new PrintStream(new File("C:\\props\\CR.txt"));
            System.setOut(outputfile);
            String part1 = "These Properties are missed or modified in your pranu file";
            String part2 = "These properties are missed or modified in your pranu3 file";
            outputfile.print(part1+"\n"+a2+"\n"+part2+"\n"+a7);
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } 
        }
            }   
</code></pre>