I've got a .txt file similar to the one below, except mine has thousands of blocks similar to the ones shown.
My goal is to find all of the 172.* entries that are NOT of a particular MAC type (say 00:0d:97:blah) and remove them. Resulting in a new file containing all but those text blocks, block being defined by 'lease x.x.x.x through next '}'. Please HELP me....
lease 10.0.0.50 {
starts 1 2007/07/23 16:41:48;
ends 1 2007/07/23 17:26:43;
tstp 1 2007/07/23 17:26:43;
binding state free;
hardware ethernet 00:11:6e:8d:2f:84;
uid "\001\000\021n\215/\204";
}
lease 172.17.65.5 {
starts 5 2007/08/03 17:02:30;
ends 6 2007/08/04 17:02:30;
tstp 6 2007/08/04 17:02:30;
binding state free;
hardware ethernet 00:0d:97:12:49:40;
}
lease 192.168.2.40 {
starts 0 2007/08/05 12:04:20;
ends 1 2007/08/06 12:04:20;
tstp 1 2007/08/06 12:04:20;
binding state free;
hardware ethernet 00:11:6e:8b:01:c4;
uid "\001\000\021n\213\001\304
";
}
Start Free Trial