program to find the uncommon numbers between two files.


 
Thread Tools Search this Thread
Contact Us Post Here to Contact Site Administrators and Moderators program to find the uncommon numbers between two files.
# 1  
Old 10-31-2007
program to find the uncommon numbers between two files.

Hi,

I need to extract the uncommon numbers from file1 and file2

For Example:

File1
1
2
3
4
5

File2
1
2
3
4
5
6
7
8
9
10

If i compare this two file the output should be iam using solaris version 5.8 pls give me script which should be compatible to run in this version Thanks in advance.

output file should be
6
7
8
9
10
# 2  
Old 10-31-2007
diff

A clumpsy solution,
Code:
 diff -e /tmp/f1 /tmp/f2 | sed -e '1d' -e '$d'

Assuming f1 & f2 has only the numbers

Thanks
Nagarajan G
# 3  
Old 10-31-2007
Thanks Nagarajan .neenga tamilaa
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

From 2 files create 3rd file with uncommon data

Hi All, I have two files. File1 and File2. Want to create another file with all the records of File1 those are not present in File2. Please guide. Thanks in advanced. Anupam (3 Replies)
Discussion started by: Anupam_Halder
3 Replies

2. Shell Programming and Scripting

Merge files based on both common and uncommon rows

Hi, I have two files A (2190 rows) and file B (1100 rows). I want to merge the contents of two files based on common field, also I need the unmatched rows from file A file A: ABC XYZ PQR file B: >LMN|chr1:11000-12456: >ABC|chr15:176578-187678: >PQR|chr3:14567-15866: output... (3 Replies)
Discussion started by: Diya123
3 Replies

3. 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

4. Homework & Coursework Questions

program to find and print a Fibonacci sequence of numbers. --Errors

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I am trying to convert a C language program over to Sparc Assembley and I am getting Undefined first referenced... (4 Replies)
Discussion started by: kenjiro310
4 Replies

5. Shell Programming and Scripting

comparing 2 files and creating third file with uncommon content

I want to compare 2 files and create third file with uncommon content. e.g. file1 ajay suhas tom nisha vijay mahish file2 ajay suhas tom nisha expected output file content vijay mahish Is it possible in single command ? Thanks, Ajay (6 Replies)
Discussion started by: ajaypatil_am
6 Replies

6. Shell Programming and Scripting

How to find the matched numbers between 2 text file using perl program??

hi dudes, I nee you kind assistance, I have to find the matched numbers from 2 text files and output of matched numbers should be in another text file.. I do have text files like this , for example File 1 787 665*5-p 5454 545-p 445-p 5454*-p File 2 5455 787 445-p 4356 2445 144 ... (3 Replies)
Discussion started by: sureshraj
3 Replies

7. UNIX for Dummies Questions & Answers

UNcommon lines between files

I have two files, file1.txt and file2.txt I want to find UNcommon between two files with while read line do grep -v $line file2.txt done<file1.txt I get the reverse grep for every line it reads (7 Replies)
Discussion started by: FelipeAd
7 Replies

8. Shell Programming and Scripting

How to find the matching numbers between 2 files Using R language??

Hi friends,, I need ur help very urgently.I have 2 files which have more than 5000 numbers,I want to find the matching numbers between 2 files using R language.I dont know how to use for loop in R.I tried to get a result,,but didnt get, file1 is like 1061909 1162391... (1 Reply)
Discussion started by: sureshraj
1 Replies

9. Shell Programming and Scripting

extracting uncommon part between two files

Hi, I need to extract the uncommon (better say incremental) part from 2 files say file_1 and file_2. file_2 contains everything that is in file_1. That is file_2 has been created internally somehow : cat file_1 temp_file > file_2 My objective is to extract the temp_file part from... (2 Replies)
Discussion started by: sabyasm
2 Replies
Login or Register to Ask a Question