From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Robert Binkley Newsgroups: gmane.os.tru64.managers Subject: Compaiting two files Date: Tue, 23 Dec 2003 11:03:23 -0600 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1072199009 11371 80.91.224.253 (23 Dec 2003 17:03:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 23 Dec 2003 17:03:29 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Tue Dec 23 18:03:25 2003 Return-path: Original-Received: from sws1.ornl.gov ([160.91.1.101]) by deer.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 1AYpwL-0000J1-00 for ; Tue, 23 Dec 2003 18:03:25 +0100 Original-Received: (qmail 5091 invoked by uid 5); 23 Dec 2003 17:03:17 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 5076 invoked by uid 49493); 23 Dec 2003 17:03:17 -0000 Original-Received: from rbinkl@comcast.net by sws1 by uid 49491 with qmail-scanner-1.16 (iscan: v3.1/v5.600-1011/622/49252. clamscan: 20030605. spamassassin: 2.55. Clear:SA:0(-1.0/5.0):. Processed in 0.771434 secs); 23 Dec 2003 17:03:17 -0000 Original-Received: from unknown (HELO emroute3.ornl.gov) (160.91.4.110) by 0 with SMTP; 23 Dec 2003 17:03:16 -0000 Original-Received: from emroute3.ornl.gov (localhost [127.0.0.1]) by emroute3.ornl.gov (PMDF V6.2-X17 #30669) with ESMTP id <0HQC006N8Y1E1D@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Tue, 23 Dec 2003 12:03:16 -0500 (EST) Original-Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by emroute3.ornl.gov (PMDF V6.2-X17 #30669) with ESMTP id <0HQC0090EY1CB7@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Tue, 23 Dec 2003 12:03:13 -0500 (EST) Original-Received: from hphome (pcp04583687pcs.shrwd01.ar.comcast.net[68.47.130.161]) by comcast.net (sccrmhc12) with SMTP id <2003122317031201200r76vbe>; Tue, 23 Dec 2003 17:03:12 +0000 Original-To: Tru64-Unix-Managers , Aix-L X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal Xref: main.gmane.org gmane.os.tru64.managers:6073 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:6073 This can be easily done with a simple Perl script... - - - - - - - - - - snip - - - - - - - - - - #!/bin/perl open(FD," ) { chomp; $in_file1{$_} = 1; } close(FD); open(FD," ) { chomp; next if ( $in_file1{$_} ); print "$_\n"; } close(FD); - - - - - - - - - - snip - - - - - - - - - - Now, if file1 looks like this: >cat file1 Item1 Item2 Item3 Item4 and file2 looks like this: >cat file2 Item5 Item4 Item2b Item1 Item6 then the output of the above Perl script will look like this: >perl perlscript Item5 Item2b Item6 Is that what you're looking for? Note that this could be easily modified to accept file names on the command line. The output could also be sorted if so desired.