union of two files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting union of two files
# 1  
Old 10-02-2007
diff of two text files

Given two files of the same format (For example number1|text1|number2) what is the command to print lines in file1 which do not occur in file2? diff command seems a bit complicated for me for this purpose. Please help!! Thank you very much.

Last edited by sherkaner; 10-02-2007 at 05:32 PM.. Reason: wrong subject
# 2  
Old 10-02-2007
I need it in awk as well as a shell script function.
I am doing it with nested while loops and parsing each line. Thought, there might be a command. Thanks for stopping by anyway.
# 3  
Old 10-02-2007
Hi.

See man comm ... cheers, drl
# 4  
Old 10-02-2007
Bug

Thank u very much drl. I probably need a manual of all such utilies in unix (solaris). I'll google for a link or so. Thanks!
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Automate splitting of files , scp files as each split completes and combine files on target server

i use the split command to split a one terabyte backup file into 10 chunks of 100 GB each. The files are split one after the other. While the files is being split, I will like to scp the files one after the other as soon as the previous one completes, from server A to Server B. Then on server B ,... (2 Replies)
Discussion started by: malaika
2 Replies

2. Programming

Event driven programming / epoll / typedef union / session data array

Sorry for the “word salad” subject, but I wanted to cast a wide net for help. I've created an IP (Internet Protocol) server which serves HTTP, SMTP, and FTP requests. As you probably know, they all require creating a socket, listening on it, accepting connections, and then having a short... (3 Replies)
Discussion started by: John S.
3 Replies

3. Programming

GDB and GCC union

My concept may sound a bit cryptic but I what some startup information as to how we can use GDB APIs / debugging techniques in programs with GCC when we compile the program. We can definitely tell gcc to link GDB libs also. The ultimate aid would be that when the compiled programs executes it... (4 Replies)
Discussion started by: uunniixx
4 Replies

4. Web Development

Intersection and union of array by hash

Hi, A piece of script from Perl-cookbook I do not understand, and post here for explanation. The purpose is to find the element in either array (union), and in both array (intersection). Thank you in advance. @a=qw(1 3 5 6 7 8); @b=qw(2 3 5 7 9); foreach $e (@a, @b) {$union{$e}++ &&... (3 Replies)
Discussion started by: yifangt
3 Replies

5. Shell Programming and Scripting

awk: union regions

Hi all, I have difficulty to solve the followign problem. mydata: StartPoint EndPoint 22 55 2222 2230 33 66 44 58 222 240 11 25 22 60 33 45 The union of above... (2 Replies)
Discussion started by: phoeberunner
2 Replies

6. Shell Programming and Scripting

How to retrieve all the linked script files/ctl files/sql files?

Hi I am going to migrate our datawarehouse system from HP Tru 64 Unix to the Red Hat Linux. Inside the box, it is running around 40 cron jobs; inside each cron job, it is calling other shell script files, and the shell script files may again call other shell script files or ctl files(for... (1 Reply)
Discussion started by: franksubramania
1 Replies

7. Shell Programming and Scripting

Text files union

How can i union two files that each of them contain text to one new file in unix shell scripting or in awk scripting language? (2 Replies)
Discussion started by: tal
2 Replies

8. Shell Programming and Scripting

How to find union of two files

Is there a command in unix to find the union of two files and removing the union from one of the files? e.g. I have two files input1.txt and input2.txt with the contents below: $ more input1.txt 4 2 3 2 $ more input2.txt 5 4 4 8 2 I want to find the union of the two and... (7 Replies)
Discussion started by: stevefox
7 Replies
Login or Register to Ask a Question