Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!apple!uokmax!occrsh!att!cbnewsd!jfb200 From: jfb200@cbnewsd.att.com (joseph.f.baugher) Newsgroups: comp.unix.questions Subject: Need script to pluck lines of text from a file Keywords: AWK,script,lines,need advice Message-ID: <1990Jun30.180958.28569@cbnewsd.att.com> Date: 30 Jun 90 18:09:58 GMT Organization: AT&T Bell Laboratories - Indian Hill - Naperville, Illinois Lines: 42 I am looking for a Shell script capable of doing the following job: I have a file consisting of several dozen lines of text, as per example: text in line 1 text in line 2 .... text in line n startmarker text in line n+1 text in line n+2 .... ... text in line n+m-1 endmarker text in line n+m+1 text in line n+m+2 .... .... where startmarker and endmarker are lines of text with characteristic markers in them which identify them as unique and different from the others. I want to be able to pipe the lines of text BETWEEN startmarker and endmarker to another command for further processing. Unfortunately, I do not know ahead of time what the numbers n and m are. I have been searching through the AWK textbook by Kernigan et. al. for some hints on how to do this, but I find this book hard to understand. IMHO, the AWK language is appropriately named, and I come from Bell Labs, no less! If anyone out there can give me pointers to a solution, I would be eternally grateful. Joe Baugher ************************************** AT&T Bell Laboratories * "Of all the gin joints in all the * 200 Park Plaza * towns in all the world, she walks * Naperville, Illinois 60566-7050 * into mine." * (708) 713 4548 ************************************** ihlpm!jfb jfb200@cbnewsd.att.com Who, me? Speak for AT&T? Surely you jest!