我知道如何打印每第n行和第n个匹配行,但不知道如何打印每第n个匹配行并且所有行都不是数学。awk打印每第n个匹配行并且所有行不是数学
输入例:
Something else 1
Downloading: file1 1%
Downloading: file1 10%
Something else 2
Downloading: file1 30%
Something else 3
Downloading: file1 40%
Downloading: file2 50%
Downloading: file1 60%
Downloading: file1 100%
Downloading: file2 100%
Something else 4
如果图案是 '^下载:' 和打印每一第二匹配线,输出应该是这样的:
Something else 1
Downloading: file1 10%
Something else 2
Something else 3
Downloading: file1 40%
Downloading: file1 60%
Downloading: file2 100%
Something else 4
显示输入片段nd预期输出 – RomanPerekhrest