Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Get un common numbers from two files Post 86934 by jingi1234 on Tuesday 18th of October 2005 12:48:00 PM
Old 10-18-2005
Get un common numbers from two files

Hi,
I have two files:

abc :

50040
123123
31703

cde:

104
97
50040
123123
31703
36609
50534


How to get all the numbers from cde which are not in abc?

result must be :
104
97
36609
50534

Thanks for your help.
Jingi
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Merge files of differrent size with one field common in both files using awk

hi, i am facing a problem in merging two files using awk, the problem is as stated below, file1: A|B|C|D|E|F|G|H|I|1 M|N|O|P|Q|R|S|T|U|2 AA|BB|CC|DD|EE|FF|GG|HH|II|1 .... .... .... file2 : 1|Mn|op|qr (2 Replies)
Discussion started by: shashi1982
2 Replies

2. Shell Programming and Scripting

Getting Common value in three files

I have 3 files 1.csv abc def 2.csv abc xyb 3.csv abc e23 frw I need to search for the common word in all the three files. How do i do that in awk ? (10 Replies)
Discussion started by: nuthalapati
10 Replies

3. Shell Programming and Scripting

finding common numbers (contents) across 2 or 3 files

I have 3 files which are tab delimited and have numbers in it. file 1 1 2 3 4 5 6 7 File 2 3 5 7 8 File 3 1 (4 Replies)
Discussion started by: Lucky Ali
4 Replies

4. UNIX for Dummies Questions & Answers

A directory of common files from two others

Hi all, that' my problem dir1: fileA fileB fileC dir2: fileA fileC I need a command in shell to obtain a dir with common files: dir_common: fileA fileC thank u all (6 Replies)
Discussion started by: pilloso
6 Replies

5. Shell Programming and Scripting

Find common numbers and print yes or no

Hi I have 2 files with following data First file, sp|Q676U5|A16L1_HUMAN, Autophagy-related protein 16-1 OS=Homo sapiens GN=ATG16L1 PE=1 SV=2, Maximum coiled-coil residue probability: 0.657 in position 163. Maximum dimeric residue probability: 0.288 in position 163. ... (1 Reply)
Discussion started by: manigrover
1 Replies

6. Shell Programming and Scripting

Compare multiple files, and extract items that are common to ALL files only

I have this code awk 'NR==FNR{a=$1;next} a' file1 file2 which does what I need it to do, but for only two files. I want to make it so that I can have multiple files (for example 30) and the code will return only the items that are in every single one of those files and ignore the ones... (7 Replies)
Discussion started by: castrojc
7 Replies

7. UNIX for Dummies Questions & Answers

Find common numbers from two very large files using awk or the like

I've got two files that each contain a 16-digit number in positions 1-16. The first file has 63,120 entries all sorted numerically. The second file has 142,479 entries, also sorted numerically. I want to read through each file and output the entries that appear in both. So far I've had no... (13 Replies)
Discussion started by: Scottie1954
13 Replies

8. Shell Programming and Scripting

awk common between files

Hello there: I want to find common among files. They all have one column. Format for data: CEU_snp_CHR21.txt 21:10758305 21:10827533 21:10913441 21:10920098 21:10952160 21:10966322 21:10985991 NAT_CHR21_variants.txt 21:10971951 (3 Replies)
Discussion started by: genome
3 Replies

9. UNIX for Beginners Questions & Answers

Comparing two files and list the difference with common first line content of both files

I have two file as given below which shows the ACL permissions of each file. I need to compare the source file with target file and list down the difference as specified below in required output. Can someone help me on this ? Source File ************* # file: /local/test_1 # owner: own #... (4 Replies)
Discussion started by: sarathy_a35
4 Replies
sdiff(1)						      General Commands Manual							  sdiff(1)

NAME
sdiff - side-by-side difference program SYNOPSIS
[options ...] file1 file2 DESCRIPTION
uses the output of diff(1) with the option, which ignores trailing blanks (spaces and tabs) and treats other strings of blanks as equal, to produce a side-by-side listing of two files, indicating those lines that are different. Each line of the two files is printed with a blank gutter between them if the lines are identical, a in the gutter if the line only exists in file1, a in the gutter if the line only exists in file2, and a for lines that are different. For example: abc | xyz abc abc bca < cba < dcb dcb > cde Options recognizes the following options: Use the next argument, n, as the width of the output line. The maximum value of n is 2048 (LINE_MAX). The default line length is 130 charac- ters. Only print on the left side when lines are identical. Do not print identical lines. Use the next argument, output, as the name of a third file that is created as a user-controlled merging of file1 and file2. Identical lines of file1 and file2 are copied to output. Sets of differences, as produced by diff(1), are printed; where a set of differ- ences share a common gutter character. After printing each set of differences, prompts the user with a and waits for one of the following user-typed commands: append the left column to the output file append the right column to the output file turn on silent mode; do not print identical lines turn off silent mode call the editor with the left column call the editor with the right column call the editor with the concatenation of left and right call the editor with a zero length file exit from the program On exit from the editor, the resulting file is concatenated on the end of the output file. EXAMPLES
Print a side-by-side diff of two versions of a file on a printer capable of printing 132 columns: Retrieve the most recently checked in version of a file from RCS and compare it with the version currently checked out: SEE ALSO
diff(1), ed(1). sdiff(1)
All times are GMT -4. The time now is 11:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy