Hi,there.I am asking for help here.I get two text files of products number.I need to compare the 2 files to get the identical products number.
The two files are attached below here.
Hi,there.I am asking for help here.I get two text files of products number.I need to compare the 2 files to get the identical products number.
The two files are attached below here.
There is a command called "diff" which will show the differences between two files, if that helps at all. The syntax, I believe, is:
diff file1.txt file2.txt
I hope this gets you on track, at least!
... also, if you use the -y modifier, it will display the files side by side, which would help you see the similarities.
Code:cat file1.txt|sed s/\"//g |awk -F\- '{print "grep "$2 " file2.txt"}' |sh >> dups.txt
Last edited by iponeverything; November 10th, 2008 at 05:11 AM. Reason: didn't look at the text files.
OK. Sorry, gave it my best shot! After some searching, I don't see a command to do exactly what you're asking. But you could try the manpage for diff:
and see if any of the options would get you close.Code:man diff
You could use "Meld" from the repositories. It is a very nice GUI diff tool, that highlight different lines from both files.
hi,iponeverything.Thank you for your nice and kind advice.
And I still get a problem here since I am not famillar with the commands of 'sed' or 'awk'.I want to check out the products number in file2 ,but not in file1 which are products already on the website.So after the comparison,i would update the the website with the missing products.
I wish you would get time and trouble to help me.Thank you in advance!
Last edited by iponeverything; November 10th, 2008 at 03:09 PM.
Bookmarks