LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] text flow tools

[ILUG] text flow tools

Brian Foster blf at blf.utvinternet.ie
Thu Jul 28 07:21:40 IST 2005


  | Date: Wed, 27 Jul 2005 23:35:19 +0100 (IST)
  | From: Paul Jakma <paul at clubi.ie>
  | On Wed, 27 Jul 2005, Paul Biggar wrote:
  | > grep can find two words one after the other by doing 'grep "word1
  | > word2"'. Does anybody know a way of making this return a case where
  | > word1 is at the end of one line, and word2 is at the start of the
  | > next.
  | 
  | Using GNU AWK, something vaguely like (untested):  [ ... ]

 I have not tried Paul's posted script, but it does point out a
 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.
 (it also does not allow trailing spaces at the end of line 1
 or leading spaces on line 2, both of which are legal and
 harmless in (La)TeX.)

 but that is not how I read Paul's question.  I read it as wanting
 to print something (nominally each line) that "matches", where a
 match is word1, whitespace (including up to one newline), then
 word2.  e.g., the single line “foo word1 word2 bar” would also
 match — which is not printed by Paul's gawk(1) solution.

cheers!
	-blf-
-- 
Experienced (20+ yrs) kernel/software Eng: | Brian Foster   Montpellier,
 • Unix, embedded, &tc;  • Linux;  • doc;  | blf at utvinternet.ie   FRANCE
 • IDL, automated testing, process, &tc.   |  Stop E$$o (ExxonMobile)!
Résumé (CV) http://www.blf.utvinternet.ie  |     http://www.stopesso.com



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell