Compare semicolon seperated data in 2 files using shell script

hello members,

I have some data ( seperated by semicolon ) with close to 240 rows in a text file temp1.
temp2.txt stores 204 rows of data ( seperated by semicolon ).
I want to :
Sort the data in both files by field1.i.e first data field in every row.
compare the data in both files and print out the rows that are not equal in seperate files.

I was trying to do this with excel using vlookup, without a great deal of success. hence, i'm exploring the shell script option.

temp1.txt
1000xyz400100xyzA00680xyz0;19722.83;19565.7;157.13;11;2.74;11.00
1000xyz400100xyzA00682xyz0;7210.68;4111.53;3099.15;216.95;1.21;216.94
1000xyz430200xyzA00651xyz0;146.70;0.00;0.00;0.00;0.00;0.00

temp2.txt
1000xyz400100xyzA00680xyz0;19722.83;19565.7;157.13;11;2.74;11.00
1000xyz400100xyzA00682xyz0;7210.68;4111.53;3099.15;216.95;1.21;216.94

Appreciate if you can get me started. I have a solaris machine, where i intend to run the scripts.

regards,

kris

Try:

sort -k1,1 temp1 -o temp1.tmp
sort -k1,1 temp2 -o temp2.tmp
comm -23 temp1.tmp temp2.tmp
sort -k1 temp1.txt -t';' > tmpfile1 && sort -k1 temp2.txt -t';' | comm -3 - tmpfile1
diff <(sort temp1.txt) <(sort temp2.txt)

Thanks for the tip.

But how do i re-direct the missing / un-matched rows to different files, so i can trace which file they belong to ?

E.g.

diff <(sort temp1.txt) <(sort temp2.txt)|awk '/^</{print $2>"temp1.out"}/^>/{print $2>"temp2.out"}'

Thanks! Just the solution I was after!