home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / editors / 2743 < prev    next >
Encoding:
Internet Message Format  |  1992-11-14  |  1.0 KB

  1. Path: sparky!uunet!ukma!usenet.ins.cwru.edu!agate!doc.ic.ac.uk!uknet!edcastle!william
  2. From: william@castle.ed.ac.uk (William Warburton)
  3. Newsgroups: comp.editors
  4. Subject: Help wanted with sed.
  5. Message-ID: <28138@castle.ed.ac.uk>
  6. Date: 13 Nov 92 18:09:46 GMT
  7. Sender: nntpusr@castle.ed.ac.uk
  8. Reply-To: W.Warburton@ed.ac.uk
  9. Organization: Edinburgh University Computing Service
  10. Lines: 21
  11.  
  12. Hi,
  13.     Can anyone tell me how to get sed to copy more than two lines
  14. into the pattern space? I want to get the pattern space to include
  15. about 5-30 lines and then write it out to one of two files according to
  16. the last part of the pattern. I envisage something like this:
  17.  
  18. /start_of_context/,/end_of_context/N
  19. /.*\nLastLine/w out_file_1
  20. /.*\nLastLine/!w out_file_2
  21.  
  22.  However the first line of the program just joins pairs of lines.
  23. I have managed to get three lines joined by using N twice but I can't
  24. work out how to extend this for the general case.
  25.  
  26.  Help!
  27.  
  28. Thanks for your advice,
  29.  
  30.         W.
  31.  
  32. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  33.