Reputation: 1
I am doing TDR cable-diagnostics on a Cisco switch and I need to know how to transfer that information to Excel (ordered).
from netmiko import ConnectHandler
#Credenciales
ip = "192.168.xx.xx"
username = "admin"
password = "pass"
pass_enable = "secret"
DEVICE_TYPE = 'cisco_ios'
conexion = ConnectHandler(ip=ip, username=username, password=password, secret=pass_enable, device_type=DEVICE_TYPE)
if not conexion.check_enable_mode():
conexion.enable()
tdr = conexion.send_command('show cable-diagnostics tdr interface Gi1/0/1', use_textfsm=True)
print(tdr)
The output is this:
SW1#show cable-diagnostics tdr interface Gi1/0/1
TDR test last run on: December 26 11:40:35
Interface Speed Local pair Pair length Remote pair Pair status
--------- ----- ---------- ------------------ ----------- --------------------
Gi1/0/1 1000M Pair A 55 +/- 10 meters Pair B Normal
Pair B 55 +/- 10 meters Pair A Normal
Pair C 55 +/- 10 meters Pair D Normal
Pair D 55 +/- 10 meters Pair C Normal
I hope you can help me, thanks
I tried to sort output to text file but I can pass it to excel sorted.
Upvotes: 0
Views: 666
Reputation: 226
Excel will paste all the data into a single column
Upvotes: 0