diff problem

Hi,
I need to get only different rows from comparing two files , i donot need the place of row or any other error comments , just my data , Can anyone help me please?
example:
$Diff -b reham.txt reham1.txt

7a8(DON'T NEED IT)
> hany 4/4/1989 $100,000
\ No newline at end of file(DON'T NEED IT)
I only need row of hany .

Try this, it shows only different records.

sdiff file1 file2 | grep "|"

does something like this work for you?

diff file1 file2 | egrep "[<|>]"

---------- Post updated at 05:44 AM ---------- Previous update was at 05:40 AM ----------

thanks for all , but can you tell me what egrep "[<|>]" means?

If you are prepared to sort both files first, take a look at the unix "comm" command.

The "diff" command is unsuitable if you only need the differences because it shows the difference in context and therefore includes lines which are not different.

Another method: Print lines which are not common. This is less thorough than using "comm" and assumes that there are no duplicate differences.

cat reham.txt reham1.txt | sort | uniq -u
$ diff reham.txt reham1.txt | egrep "[<|>]"
<
<
< reham     2/5/2011               $20,000
> reham      2/5/2010                  $20,000
<
<
<
<
> hany       4/4/1989               $100,000

I really don't need to this empty rows between them

---------- Post updated at 06:36 AM ---------- Previous update was at 06:30 AM ----------

and when result appear all rows appear together, but what i need to make rows of first file be in a file , and rows from second file in another file

The "comm" approach expanded.

sort reham.txt > /tmp/reham.sor
sort reham1.txt > /tmp/reham1.sor
# Records in reham.sor but not in reham1.sor
comm -23 reham.sor reham1.sor
# Records in reham1.sor but not in reham.sor
comm -13 reham.sor reham1.sor

there is an option for "diff" to suppress blank lines... check the man page.

when result appear all rows appear together, but what i need to make rows of first file be in a file , and rows from second file in another file

---------- Post updated at 08:20 AM ---------- Previous update was at 07:24 AM ----------

Hi,all
I made another program , but i have a problem on it to .
Can you please tell me how can i ignore special characters (space, comma , black blank) in my comparison between two files my code is :

#!/bin/sh
cat > des1 <<EOF
EOF
cat > des2 <<EOF
EOF
awk 'FNR==NR{tab[$0]++} FNR!=NR && !tab[$0]' $1 $2  > des1
echo " difference in file $2 is :"
cat des1
awk 'FNR==NR{tab[$0]++} FNR!=NR && !tab[$0]' $2  $1 > des2
echo " difference in file $1 is :"
cat des2

Thank you