Thanks. I currently do this:
As you might guess, I'm using this to open a "show run" router dump. I've already dealt with the limitation of Application.MAtch if my text file is too big.
Here is how I find the correct interface (which is supposed to match a cell on my worksheet:
If you know anything about Cisco routers, you notice that looking for the interface the way I do with the bangs ("!") is silly, but for other searches I'm being consistent.
Plus, for other things (like vrf or ip route, etc) I would use the bangs to help search for proper start/end of line hits.
In BGP code, I might looks for "! neighbor " which is different than "! neighbor".
In a static route, I would Filter for a gateway IP at the end of a line, similar to " 42.68.101.12!".
If I were looking for a matching neighbor, I'd Filter for "! neighbor 42.68.101.12" or "! neighbor 42.68.101.12".
For something like an "ip route" I Filter using the IP ending with a bang, then use a For/Next on LBound/UBound on the Filter results to match lines that start "!ip route" (and if looking for public routes, skipping "!ip route vrf".
Instead of using ReDim, I tend to Join and array into a delimited string, the Split it back to a correctly sized array.
Bookmarks