Mar 8, 2005 #1 stu78 Programmer May 29, 2002 121 GB Hi, How could I do a comparisoin between 2 files, and remove the data which is in file1 from file2? Is this possible?
Hi, How could I do a comparisoin between 2 files, and remove the data which is in file1 from file2? Is this possible?
Mar 8, 2005 #2 johnherman MIS Oct 10, 2003 2,323 US Check out the diff command ------------------------- The trouble with doing something right the first time is that noboby appreciates how difficult it was. - Steven Wright Upvote 0 Downvote
Check out the diff command ------------------------- The trouble with doing something right the first time is that noboby appreciates how difficult it was. - Steven Wright
Mar 8, 2005 #3 vgersh99 Programmer Jul 27, 2000 2,146 US man comm vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+ Upvote 0 Downvote
man comm vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+
Mar 8, 2005 #4 xmb Programmer Feb 11, 2005 213 CH If the files aint 1:1 line-mapped, comm is not much of use. Some awk: Code: { if (NR == FNR) Seen[$0]; else if (! ($0 in Seen)) print } . Mac for productivity .. Linux for developement ... Windows for solitaire Upvote 0 Downvote
If the files aint 1:1 line-mapped, comm is not much of use. Some awk: Code: { if (NR == FNR) Seen[$0]; else if (! ($0 in Seen)) print } . Mac for productivity .. Linux for developement ... Windows for solitaire
Mar 9, 2005 #5 futurelet Programmer Mar 3, 2004 539 US Here's another way of implementing xmb's algorithm: Code: NR==FNR { a[$0]; next } !($0 in a) Run it with [tt]awk -f comp.awk file1 file2[/tt] Upvote 0 Downvote
Here's another way of implementing xmb's algorithm: Code: NR==FNR { a[$0]; next } !($0 in a) Run it with [tt]awk -f comp.awk file1 file2[/tt]