From owner-freebsd-questions Wed Sep 2 20:33:49 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA04656 for freebsd-questions-outgoing; Wed, 2 Sep 1998 20:33:49 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from server5.singular.com (server5.singular.com [204.140.208.22]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA04651 for ; Wed, 2 Sep 1998 20:33:48 -0700 (PDT) (envelope-from JBarbee@server5.singular.com) Received: by server5.singular.com with Internet Mail Service (5.5.2232.9) id ; Wed, 2 Sep 1998 20:33:27 -0700 Message-ID: <71B40CA7B273D0119DBF080009B46D4003E185@server5.singular.com> From: John Barbee To: "'Roman Katsnelson'" , "q's" Subject: RE: grep question Date: Wed, 2 Sep 1998 20:33:21 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2232.9) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG i just tried it without the A and B flags and it works. -----Original Message----- From: Roman Katsnelson [mailto:romank@graphnet.com] Sent: Wednesday, September 02, 1998 1:12 PM To: q's Subject: grep question 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message