有没有办法将这种模式与shell或sed相匹配?
发布时间:2020-12-16 01:34:17 所属栏目:安全 来源:网络整理
导读:我有一个包含以下输出的文件: BP 0 test: case id Name ====== ======== ================= 0 82 a_case-2-0-0 BP 1 test: case id Name ====== ======== ================= 0 86 a_case-2-1-0 BP 2 test: case id Name ====== ======== =================B
我有一个包含以下输出的文件:
BP 0 test: case id Name ====== ======== ================= 0 82 a_case-2-0-0 BP 1 test: case id Name ====== ======== ================= 0 86 a_case-2-1-0 BP 2 test: case id Name ====== ======== ================= BP 3 test: case id Name ====== ======== ================= 0 93 a_case-2-3-0 所以,只有“BP 0,1,3”才有内容,所以我想要的是,是否有可能只进行’BP 0测试’,’BP 1测试’和’BP 3测试’,只想进入’ BP 2测试’因为没有测试用例. 谢谢你的帮助. $awk -F'n' -v RS='' -v ORS='nn' 'NF>3' input.txt BP 0 test: case id Name ====== ======== ================= 0 82 a_case-2-0-0 BP 1 test: case id Name ====== ======== ================= 0 86 a_case-2-1-0 BP 3 test: case id Name ====== ======== ================= 0 93 a_case-2-3-0 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |