On Mon, Dec 21, 2009 at 3:36 AM, Noor Mulla <Noor.Mulla@xxxxxx> wrote: > However, if the contents in both the files are not in sequence(side by > side) its not giving the correct output. > > I am using this command - diff a.txt b.txt |awk '{ if($2 != $4) print }'| > awk '{printf "%s %s\n",$1, $4}'> result.out > > How can I get the results irrespective of data not sorted or is there a way > that both files can be sorted for order and ignore space/tab etc. > > Doing so without programming will require ignoring or removing blank lines, and sorting the data prior to doing the diff. See the sort and diff man pages - most 'diff's can ignore blanks. > > > Finally, I want to send the result to my manager via mailx …. > > ... > > How can I club all 3 result* file into one. If I open output.txt file I > should be able to identify result1.out,result2.out etc… > > > Read the man page for whatever shell you are using. Redirect can be used in both overwrite and append mode. In regards to my previous reply - it looks like you are making an attempt to solve this on your own. :) Jared Still Certifiable Oracle DBA and Part Time Perl Evangelist Oracle Blog: http://jkstill.blogspot.com Home Page: http://jaredstill.com