[ILUG] text flow tools
paul.biggar at gmail.com
Thu Jul 28 18:19:58 IST 2005
On 7/28/05, Paul Jakma <paul at clubi.ie> wrote:
> On Thu, 28 Jul 2005, Brian Foster wrote:
> > possible confusion/unclarity in Paul's request. it looks to me
> > that Paul's script will _only_ print matches when word1 is at
> > the end of a line and word2 is at the start of the next line.
> No wait.. that *is* exactly what PB asked for, I quoted his request
> before my awk suggestion:
My fault, apologies, I should have made it much clearer. What I was
looking for was a way to make grep treat newlines as spaces, and so
treat flowed paragraphs in a pleasant manner. I asked how to match two
words, split across a new line, but what I really should have asked
for is how to match N words in a phrase or sentence, where they may be
split over 1, or possibly more lines.
In other words, I wanted to do 'grep "I quoted his request before my
awk suggestion"' and get back the two lines above. A way to do this
with grep, rather than emulating it with awk, sed or perl, would be
best, as its then easy to use some of the fancyness like -n,
--color=auto, or -A 1 -B 1.
Thanks to all who replied.
More information about the ILUG