10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have two text files, compare column one in both the files and if it matches then the output should contain the id in column one, the number and the description.
Both the files are sorted. Is there a one liner to get this done, kindly help. Thank you
NC_000964 92.33 ... (2 Replies)
Discussion started by: pulikoti
2. Shell Programming and Scripting
i am working on a shell script and need help in the comparing part of it. for e.g. there two text files like this:
file1 has to be comared with file2
and during comparision with defaultfile.txt
if... (2 Replies)
Discussion started by: draghun9
3. Shell Programming and Scripting
I am trying to compare two text files and output the difference to another file.
I'm not strictly looking for differences in text but additional text at the end of one file that isn't in another, so basically comparing the file 2 against file 1 and printing any additional text to... (9 Replies)
Discussion started by: martin0852
4. UNIX for Dummies Questions & Answers
I have file1 and file2, two text files containing various lines.
I'm trying to find a way to compare file1 and file2:
If the first 7 characters of a line in file2 match the first 7 characters of a line in file1, then do not do anything.
Print out the lines of file1 (in file3,... (3 Replies)
Discussion started by: bobylapointe
5. Shell Programming and Scripting
I have two files,
the file name is
Now i want to compare the value in sec.txt file with disp.txt file
Excatly i want to compare the value 3172 in first file and 45676 in second file.
i want to compare the first line of... (11 Replies)
Discussion started by: rammm
6. Shell Programming and Scripting
I am looking for a way to compare two text files and print the matches. For example;
Output: (11 Replies)
Discussion started by: lewk
7. Shell Programming and Scripting
Could you please help me on below one ..
etDefaultLogin=gurathi (1 Reply)
Discussion started by: nivas_k2006
8. Shell Programming and Scripting
I know the diff does this but it does output more info than just the different text
$ diff file1 file2
How can I make it output only
thank... (2 Replies)
Discussion started by: hakermania
9. Shell Programming and Scripting
I'mvery new to shell scripting and learning it now
currently i am having a problem which may look easy to u :)
i have two files
Start :Thu Nov 19 10:33:09 2009
Start... (10 Replies)
Discussion started by: CelvinSaran
10. UNIX for Advanced & Expert Users
I have two txt files like this
Now i want to compare col1 from File and col2 from File2, if its match i want fetch all columns from... (3 Replies)
Discussion started by: psiva_arul
COMM(1) BSD General Commands Manual COMM(1)
comm -- select or reject lines common to two files
comm [-123i] file1 file2
The comm utility reads file1 and file2, which should be sorted lexically, and produces three text columns as output: lines only in file1;
lines only in file2; and lines in both files.
The filename ``-'' means the standard input.
The following options are available:
-1 Suppress printing of column 1, lines only in file1.
-2 Suppress printing of column 2, lines only in file2.
-3 Suppress printing of column 3, lines common to both.
-i Case insensitive comparison of lines.
Each column will have a number of tab characters prepended to it equal to the number of lower numbered columns that are being printed. For
example, if column number two is being suppressed, lines printed in column number one will not have any tabs preceding them, and lines
printed in column number three will have one.
The comm utility assumes that the files are lexically sorted; all characters participate in line comparisons.
The LANG, LC_ALL, LC_COLLATE, and LC_CTYPE environment variables affect the execution of comm as described in environ(7).
The comm utility exits 0 on success, and >0 if an error occurs.
cmp(1), diff(1), sort(1), uniq(1)
The comm utility conforms to IEEE Std 1003.2-1992 (``POSIX.2'').
The -i option is an extension to the POSIX standard.
A comm command appeared in Version 4 AT&T UNIX.
December 12, 2009 BSD