C:\Test>type a.txt
<提取行>AAAAAAA(字符串1)BBBBBBBB(字符串2)CCCCCC(字符串3)
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
<提取行>AAAAAAA(字符串4)BBBBBBBB(字符串5)CCCCCC
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu- gawk "/<提取行>/{n=split($0,a,\")\");for(i=1;i<n-1;i++)printf \"%s(\",a[i];print a[i]}" a.txt | gawk -F( "{for(i=2;i<NF;i+=2)printf \"%s;\",$i;print $i}" >b.txt
复制代码 C:\Test>type b.txt
字符串1;字符串2;字符串3
字符串4;字符串5 |