帮我做一个小工具 原表第一张图片这样的 我需要把这个表里的格式改成我第二张照片的格式 我想你帮...

बनाया गया: 10 जुलाई 2026

का उपयोग करके उत्तर दिया गया GPT-5.6 Thinking द्वारा Chat01

प्रश्न

图片.png
图片.png

帮我做一个小工具 原表第一张图片这样的 我需要把这个表里的格式改成我第二张照片的格式 我想你帮我写一个轻量化的工具帮我完成 能够实现我批量导入和导出的

विचार

Fixing self-test and output handling

I need to fix the self-test import since it did a py_compile. I'll also try removing the __pycache__ from the zip and test by using sys.modules or runpy. I found a minor bug with file dialog patterns on Windows, and some issues with the handling of .xlsm files. Since the output workbook can’t preserve macros, I should remove the macro option entirely to avoid confusion. I'll just support .xlsx for the output.

Thought for 2m 45s

उत्तर

已按你两张截图的转换逻辑做好一个 Windows 轻量化工具:

转换格式

text
本端:区域前缀-本端机柜-设备简称-端口 对端:区域前缀-对端机柜-设备简称-端口

例如:

text
本端:B1-2A-G17-6U-WAF应用防护-ETH1 对端:B1-2A-G17-35U-防火墙-ETH2

工具支持:

  • 批量导入多个 .xlsx.xlsm 文件
  • 一次导入整个文件夹
  • 自动识别表头所在行
  • 自动处理原表中的合并单元格
  • 自动识别本端和对端两组“槽位/板卡、端口”
  • 每个原文件单独导出一个“转换结果.xlsx”
  • 自定义 B1-2A 等区域前缀
  • 自定义设备简称规则,例如“WEB应用防护→WAF应用防护”
  • 可打包成独立 .exe

下载网络链路表批量转换工具

解压后,双击 “启动工具.bat” 即可运行。首次运行需要电脑安装 Python,压缩包中也包含 “打包为EXE.bat”,可生成不依赖 Python 的独立程序。

इस प्रश्नोत्तर को साझा करें