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 multiple files using diff
Name: bengalliboy Date: August 19, 2004 at 13:47:31 Pacific OS: UNIX CPU/Ram: 450
Comment:
I am comparing two files fine using diff as follows and manipulating the results: diff FileA FileB | sort -u > result How do I do the same for a sets of file some thing like this: comapare set of File A with File A' and File B with File B' and have the result onto a file. So, Looking for some thing: add the result of 'diff fileA fileA' with 'diff FileB FileB' and so on and sort and get unique records...
Should I use a pipe/cat ? Or an Array ? Note, I need to several sets comparison. So I am looking on efficiency.
Name: Jake2 Date: August 23, 2004 at 19:34:07 Pacific
Reply:
I would put A, B... in directory1 and A', B'... in directory2 but with the same names used in directory1 (A, B...), then run "diff -u directory1 directory2".
Other interesting options for diff are -N for new files, -a for forcing ASCII, and -r for recursing subdirectories. For example, I use "diff -Nuar dir1 dir2" for Linux kernel trees.
0
Response Number 2
Name: h4x3r Date: August 24, 2004 at 10:29:42 Pacific
Summary: Hi, compare two files and difference will be moved into separate file.if anybody having code for this please send asap. using diff command how can we write the shell programming and my first file is...
Summary: Can anyone point me in the right direction to compare two files and combine them using awk. Example. File1 Data 2442,Sep,16,2006,ACTIVE 2068,Aug,17,2006,ACTIVE 2245,Sep,20,2006,ACTIVE 2044,Jun,29,2006...
Summary: Hi, I have to compare 2 files using shell script. I need to take the each entry/line from the first file and compare it with 2nd file whether that entry exists in second file or not. If found...ok..el...