From owner-freebsd-questions@FreeBSD.ORG Mon Aug 7 20:26:08 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2004216A513 for ; Mon, 7 Aug 2006 20:26:08 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6701343D68 for ; Mon, 7 Aug 2006 20:25:42 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from localhost (localhost [127.0.0.1]) by pi.codefab.com (Postfix) with ESMTP id 1E8145C8D; Mon, 7 Aug 2006 16:25:20 -0400 (EDT) X-Virus-Scanned: amavisd-new at codefab.com Received: from pi.codefab.com ([127.0.0.1]) by localhost (pi.codefab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QC90aU3Jcgr9; Mon, 7 Aug 2006 16:25:19 -0400 (EDT) Received: from [199.103.21.238] (pan.codefab.com [199.103.21.238]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by pi.codefab.com (Postfix) with ESMTP id 2B60B5C8B; Mon, 7 Aug 2006 16:25:19 -0400 (EDT) In-Reply-To: <20060807194014.GC4120@ns2.wananchi.com> References: <20060807194014.GC4120@ns2.wananchi.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Charles Swiger Date: Mon, 7 Aug 2006 16:25:18 -0400 To: Odhiambo Washington X-Mailer: Apple Mail (2.752.2) Cc: freebsd-questions@freebsd.org Subject: Re: How to filter the contents of two text files .. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2006 20:26:08 -0000 On Aug 7, 2006, at 3:40 PM, Odhiambo Washington wrote: > I have two text files, each has just a single column of data > > FileA has 2798 entries, while FileB has 4242 entries; > There are entries in FileA that are also in FileB... > > I'd like to filter against the two files, so I only get those > entries in FileB > that don't occur only in FileA .... See "man comm"; also note that you will have to sort the contents of files first. -- -Chuck