Computing.Net > Forums > Unix > comparing two tables

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

comparing two tables

Reply to Message Icon

Name: bab123
Date: December 15, 2008 at 01:27:15 Pacific
OS: unix
CPU/Ram: aa
Product: Aa / AA
Comment:

hi,
I have a table containinng around 70,000 rows and 2 coloumns.
the table is updated every day.(new rows will be added and some rows will be deleted).
i need to write a shell script such a way that the difference between yesterdays table and todays table should be written to a new file.
the no of rows in yesterdays table and todays table are different.all the rows in yesterday table may or maynot present in todays table
i want the out put in such a way that the new file should contain the rows that are present yesterday and changed in any one column in todays table

example.

file1

aaa,bbb
ccc,ddd
eee,fff
ggg,hhh


file2

bbb,rrr
ccc,ppp
eee,fff
kkk,hhh
mmm,lll

desired output

ccc,ddd
ccc,ppp
ggg,hhh
kkk,hhh

I
tried with comm -3 comand
but i am geeting the different rows in two tables as well as new rows in table2 and old rows in table 1.
i want only the rows in which there is a change in coloumn value from yesterday table to today table
please help me
thanks



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: comparing two tables

compare two files and diff file wil www.computing.net/answers/unix/compare-two-files-and-diff-file-wil/7363.html

Fail to compare two strings www.computing.net/answers/unix/fail-to-compare-two-strings-/4748.html

Compare two variables in shell script www.computing.net/answers/unix/compare-two-variables-in-shell-script-/3611.html