grepping for multi-line output
i can't get any reference about this online nor with the man page, so I need some tips here.
my situation;
- i have a file which contains plain text records with each record consisting of 1 to 4 lines. how do i grep (or whatever tool) the record number and print all the lines related to that record? each record is separated by lines made up of dashes. ie:
------------------------------------------------------------
yyyymmdd blahsdfdf dkfdkflasjfljdflj recordnum
blah blah blah
blah blah blah yada yada
------------------------------------------------------------
i might be using the wrong tool (grep and awk) or what?
thanks.
|