[Cialug] Grep Block of Text

Jared Brees fromj2sitsme at msn.com
Fri Nov 15 04:03:41 UTC 2019


So you're looking for Perl?

:-)

________________________________
From: Cialug <cialug-bounces at cialug.org> on behalf of Todd Walton <tdwalton at gmail.com>
Sent: Thursday, November 14, 2019 07:42
To: Central Iowa Linux Users Group <cialug at cialug.org>
Subject: Re: [Cialug] Grep Block of Text

On Thu, Nov 14, 2019 at 8:19 AM Todd Walton <tdwalton at gmail.com> wrote:

> More often than I'd expect, I find myself wanting to grep for a certain
> pattern in a certain file, and have it return the entire block of text that
> the pattern was in. I wish I had a single command that took three inputs, a
> pattern defining the start of the block, a pattern to find, and a pattern
> defining the end of the block of text.
>

It'd be super cool if I could search for a pattern and tell it to just
gimme the block back, without specifying block starts and ends. Like,
figure it out yourself, little program. Many years back I had a piece of
DOS software called Monarch that would extract patterns from text. You had
to enter information about how the text was structured, but it also had
some ability to do it itself. Like, if you had text in columns it could
reasonably figure out that you wanted those columns to line up. It was the
grooviest thing. I'm sure my memory inflates its groovyness a little, but
it really was awesome. These days I mostly use awk, sed, column, and Miller
(http://johnkerl.org/miller/doc/) for text processing.

--
Todd
_______________________________________________
Cialug mailing list
Cialug at cialug.org
https://www.cialug.org/cgi-bin/mailman/listinfo/cialug


More information about the Cialug mailing list