有没有办法将这种模式与shell或sed相匹配?

前端之家收集整理的这篇文章主要介绍了有没有办法将这种模式与shell或sed相匹配?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个包含以下输出文件
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='\n\n' '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

猜你在找的Bash相关文章