Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-23-2002
Registered User
 

Join Date: Feb 2002
Posts: 19
Question diff 2 files; output diff's to 3rd file

Hello,
I want to compare two files. All records in file 2 that are not in file 1 should be output to file 3.

For example:

file 1
123
1234
123456

file 2
123
2345
23456

file 3 should have
2345
23456

I have looked at diff, bdiff, cmp, comm, diff3 without any luck!

Thanks for your help
Barbara
Sponsored Links
  #2 (permalink)  
Old 05-23-2002
Registered User
 

Join Date: May 2002
Posts: 1
comm -23 file2 file1 > file3 should get you what you are looking for.
  #3 (permalink)  
Old 05-28-2002
Registered User
 

Join Date: Feb 2002
Posts: 19
Smile diff 2 files; output diff's to 3rd file

Thanks for the info, it works!

When I read "man" about comm, it had mentioned the output as being "text columns". This confused me, because I wanted the different records.

Thanks again,
Barbara
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Formatting the output from diff ragavhere Shell Programming and Scripting 9 05-07-2008 05:40 AM
Diff output, unwanted characters scanner248 UNIX for Dummies Questions & Answers 5 10-17-2007 05:23 PM
Is there a way to limit DIFF output bobk544 Shell Programming and Scripting 2 06-08-2007 04:54 PM
parsing output from a diff command... kam Shell Programming and Scripting 5 05-30-2007 12:26 AM
diff output paulp UNIX for Dummies Questions & Answers 3 04-14-2005 03:27 AM



All times are GMT -4. The time now is 12:04 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0