【发布时间】:2019-11-13 16:01:44
【问题描述】:
我需要将两个具有固定行块的文本文件合并为一个。
我该怎么做?
bridge-domain AAAA
mac
aging
time 3
!
limit
maximum 12
notification both
!
port-down flush disable
!
igmp snooping profile igmp-snoop <---
在这一行之后,我需要从另一个文本文件中添加一行行,如下所示:
interface Bundle-Ether AAAAA
igmp snooping profile igmp-snoop
dhcp ipv4 snoop profile
static-mac-address 0001
static-mac-address 0002
!
所以基本上我需要从 text2.txt 中每 6 行读取一次,然后每 12 行将其附加到 text1.txt 中
期望的输出:
bridge-domain AAAA
mac
aging
time 3
!
limit
maximum 12
notification both
!
port-down flush disable
!
igmp snooping profile igmp-snoop
interface Bundle-Ether AAAAA
igmp snooping profile igmp-snoop
dhcp ipv4 snoop profile
static-mac-address 0001
static-mac-address 0002
!
bridge-domain BBBB
mac
aging
time 3
!
limit
maximum 12
notification both
!
port-down flush disable
!
igmp snooping profile igmp-snoop
interface Bundle-Ether BBBB
igmp snooping profile igmp-snoop
dhcp ipv4 snoop profile
static-mac-address 0001
static-mac-address 0002
!
等...直到文件结束。
【问题讨论】: