| Raw Input
|
The datafile consists of records where
- each record may contain only one line or multiple lines.
- the first line of a record is of the format:
Machine hostname-of-machine
- other lines of a record (if exist) keep other information.
For example:
| Machine pc-a01
Machine pc-a02
connection time-out.
unable to update virus code.
Machine pc-c01
Machine pc-c02
packets loss beyond 33% while ping.
unable to open share.
Machine pc-c03
|
|
| Desired Output
| |
As seen in the example, only machines pc-a02 and pc-c02 contain extra
information, what we want is keeping data of pc-a02 and pc-c02 while
removing other:
| Machine pc-a02
connection time-out.
unable to update virus code.
Machine pc-c02
packets loss beyond 33% while ping.
unable to open share.
|
|
Script and Comments
Script1 [ 1] /^Machine /!b
[ 2] $d
[ 3] N
[ 4] /\nMachine/D
| |