Differencre between two text files to a third text file
Hi!
I want the difference of two text files(a.txt & b.txt) into a third text file(c.txt). i.e. New or Differert rows of a.txt compared to b.txt a.txt> 10128|10153|999999 10343|10153|000 10345|10153|3846 10351|10153|3846 b.txt> 10128|10153|999999 10343|10153|3853 10345|10153|3853 10349|10153|3853 c.txt should be like> 10343|10153|000 10351|10153|3846 I tried comm,but man says that the files have to be sorted in order to use comm. I dont want to sort the files. Thanks in Advance |
Try using this:
diff a.txt b.txt >> c.txt |
That gives a lot of other information. I want only the rows from a.txt.
c.txt should have only this. |
Code:
diff --suppress-common-lines --side-by-side a.txt b.txt|cut -f 1 >c.txt |
All times are GMT -5. The time now is 01:21 AM. |