thanks olded, That looks like a start. I have never used awk before but will give it a crap shoot.
Basically Im trying to grep through a router config and take all the ACLs, networkobjects and place them in a sep. file. Not to hard but for the network object part I the object list would go as follows
object-group network test-group
network-object host 10.10.10.10
network-object 192.168.1.0 255.255.255.0
network-object 192.168.50.0 255.255.255.0
network-object 192.168.60.0 255.255.255.0
access-list acl_inside permit ip any any
access-list acl_inside permit ip any host 64.0.0.6
access-list acl_inside permit ip any host 64.0.0.7
So basically what I want is to grep for the string "object-group". If the the grep returns a value then continue to grep directly after that line for "network-object" and output those values until the next line does not match.
Im going to try to use AWK, If not that then Perl. I like that perl can be run on windows and unix.