Good day community,
The file i have is an output from a router, where the printed format is repeated for every tunnel. The tunnel output looks like this, and then repeats for every tunnel found. The trouble is i want to take the repeated “key” names, ie, connection, index, ip addr, etc…, and make them columns, and for every corresponding value next to it, write the cell value. Is this something i can use with pandas, or is best approach to search “key” in line and write corresponding value?
Here is a small extract.
Connection : CONNEC-VPN
Index : 63384 IP Addr : 196.x.x.x
Encryption : IKEv2: (1)AES256 IPsec: (7)AES256
Hashing : IKEv2: (1)SHA256 IPsec: (7)SHA256
Connection : PROD-VPN
Index : 68963 IP Addr : 196.5.x.x
Encryption : IKEv2: (1)AES256 IPsec: (15)AES256
Hashing : IKEv2: (1)SHA256 IPsec: (15)SHA256
Connection : COMP-VPN
Index : 73644 IP Addr : 197.x.x.x
Encryption : IKEv1: (1)AES256 IPsec: (4)AES256
Hashing : IKEv1: (1)SHA1 IPsec: (4)SHA1
I have simply tried to see if excel can pivot the file, but it complains about duplicate values. And in previous attempts on older projects with a similar file, i couldn’t get it right with panda csv writer.