From owner-freebsd-questions Wed Sep 2 13:05:59 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA24387 for freebsd-questions-outgoing; Wed, 2 Sep 1998 13:05:59 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from netra.graphnet.com (netra.graphnet.com [192.206.112.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA24381 for ; Wed, 2 Sep 1998 13:05:56 -0700 (PDT) (envelope-from romank@graphnet.com) Received: from graphnet.com (roman.graphnet.com [192.206.112.93]) by netra.graphnet.com (8.8.8/8.8.6) with ESMTP id QAA18151 for ; Wed, 2 Sep 1998 16:04:54 -0400 (EDT) Message-ID: <35EDA68A.F931FA64@graphnet.com> Date: Wed, 02 Sep 1998 16:11:54 -0400 From: Roman Katsnelson Organization: Graphnet, Inc X-Mailer: Mozilla 4.05 [en] (WinNT; U) MIME-Version: 1.0 To: "q's" Subject: grep question Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I have a flat data file with fields that are 16 lines long, of which the third line is always unique. I need to be able to automate deleting these records. When I do this: grep -e "unique_string" -A 13 -B 2 database.file it works fine and shows me the record, and only the record. I thought I could use the -v flag like this: grep -e "unique_string" -A 13 -B 2 -v database.file to get an output of everything BUT the record, and from that point it's a piece of cake. however, that command returns the entire file. i read the man pages about 45 trillion times and i really can't come up with anything else to do. is this even possible with grep or should i just break down and use perl? Thanks as always, Roman -- /-------------------------------------------------------------------\ |Roman Katsnelson | "If voting could result in any | |Unix SysAdmin | significant changes, it would be | |Graphnet | illegal." WWW.WAIT.ORG | \-------------------------------------------------------------------/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message