Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting


Thread Tools Rate Thread Display Modes
Old 01-15-2021, 02:13 AM
saanajjar saanajjar is offline
Registered User
Join Date: Mar 2014
Posts: 1
Unhappy Need a help


i wanna to do below function so i wanna help as im new to this .

10926752_MOH#sh arp | in GigabitEthernet0/0/1.700
Internet - 10b3.c67f.7f11 ARPA GigabitEthernet0/0/1.700
Internet 9 7cc3.8537.9b5b ARPA GigabitEthernet0/0/1.700
Internet 15 1802.2d30.c3c0 ARPA GigabitEthernet0/0/1.700
Internet 14 1802.2d30.c5a0 ARPA GigabitEthernet0/0/1.700
Internet 15 1802.2d30.c700 ARPA GigabitEthernet0/0/1.700
Internet 15 1802.2d30.c460 ARPA GigabitEthernet0/0/1.700
Internet 12 1802.2d30.dea0 ARPA GigabitEthernet0/0/1.700
Internet 14 1802.2d30.c520 ARPA GigabitEthernet0/0/1.700
Internet 15 1802.2d30.c2c0 ARPA GigabitEthernet0/0/1.700

I need to copy from above output the IP to Variable A and MAC address to Variable B


B= 1802.2d30.c2c0

i need a script to do this
Reply With Quote
Old 01-15-2021, 10:12 AM
bgagnon bgagnon is offline
VanDyke Technical Support
Join Date: Oct 2008
Posts: 4,636
Hi saanajjar,

We don't write custom scripts but there are many examples of parsing data sprinkled throughout the forums.

What version of SecureCRT? On what platform?

First, I would suggest you read Chapter 4 of the Scripting Manual.

Even if you choose to write your script in another scripting language, this will provide you the necessary concepts of capturing data. You likely are going to need to use a regular expression to parse the specific data. That information is found near the end of chapter 4.

Here is a forum thread that has regex info about capturing MAC addresses. The first post is where the script code was provided, but you'll need to read the responses as jdev had to help mybox65 work out some problems in their script.

VanDyke Software
Technical Support
(505) 332-5730
Reply With Quote


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 06:21 AM.