"""
python
import os
import re
import pandas as pd
#from openpyxl import Workbook
#wb = Workbook()
#ws = wb.active
one={}
all1=[]
columns = ['sysname', 'ipv6','file_name']
txt_files = []
for root, dirs, files in os.walk(os.getcwd()):
for file in files:
if file.endswith(".cfg"):
txt_files.append(os.path.join(root, file))
print(txt_files)
for file_name in txt_files:
with open(file_name, 'r') as file:
one={}
for line in file.readlines():
if line.startswith("sysname"):
one["sysname"]=line.replace("sysname", '').replace('\n', '').strip()
if line.startswith(" ipv6 address"):
one["ipv6"]=line.replace('ipv6 address', '').replace('\n', '').strip()
break
one["file_name"]=file_name
all1.append(one)
df = pd.DataFrame(all1)
df.to_excel('result.xlsx', index=False)
"""