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 files
Name: chew Date: March 20, 2008 at 00:02:46 Pacific OS: solaris 5.9 CPU/Ram: - Product: -
Comment:
hi,
file1: hello hi test god
file2: hi hello
let's say file one is a masterfile, and i wanted to print out string that are in file1 and NOT in file2.. how do i do that? i'm not able to use the diff command as DIFF COMMAND compares line one in file1 with line one in file2.
Name: nails Date: March 20, 2008 at 11:18:01 Pacific
Reply:
Take a look at the Unix comm command, select or reject lines common to two files.
0
Response Number 2
Name: James Boothe Date: March 20, 2008 at 12:06:49 Pacific
Reply:
comm -23 file1s file2s
That comm solution (like diff) does require sorting both files first.
And also like diff, this is a line-per-line matchup. If file2 has a single line "hello", and file1 has two or more of those lines, the comm command will match up and ignore one pair, but the additional hello lines in file1, being unmatched, would print.
And that may be what you want.
Following is a solution that does not require sorting the files, and if a line exists in file2, that will cause all occurrences of that line in file1 to be ignored.
Summary: Pleaser help... Compare file names then move to new directory: How do I compare the files in different directories to see if they are the same? I need to move the new files to another directory if th...
Summary: hie there, i would like to know how do i compare files in a current directory? i don't want to compare just 2 files with the diff filename1 filename2. i need to compare all the files in the cur...
Summary: I am trying to find out if files are staying in a directory queue longer than 15 minutes. If so I want to move them to a different directory. Can anyone help with the time compare? I'm pretty new at t...