Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Sep 1998 20:33:21 -0700 
From:      John Barbee <JBarbee@server5.singular.com>
To:        "'Roman Katsnelson'" <romank@graphnet.com>, "q's" <freebsd-questions@FreeBSD.ORG>
Subject:   RE: grep question
Message-ID:  <71B40CA7B273D0119DBF080009B46D4003E185@server5.singular.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?71B40CA7B273D0119DBF080009B46D4003E185>