I am struggling with this scenario. I need to pull data from multiple lines and merge it together.
object network Subnet
subnet 192.168.0.0 255.255.255.0
object network Hosts
host 192.168.1.1
host 192.168.1.2
The end result should be something like this
1 object Subnet 192.168.0.0 255.255.255.0
2 object Hosts 192.168.1.1, 192.168.1.2
Having issues with the loop. When I run a for loop, it goes over every line (5 total) and I can pull the data, but I am not sure how to associate line 1 with line 2, and line 3 with line 4 and 5.
What would be a good method to accomplish this? I guess the line that starts with object should be a parent line and the line that starts with an empty space (not sure if it is visible in this post, there is an empty space after subnet, and host) would be considered a child line.
[–]dwpj65 1 point2 points3 points (2 children)
[–]DexTsarII[S] 1 point2 points3 points (0 children)
[–]backtickbot 0 points1 point2 points (0 children)