账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    用python查找连续行
    59
    0

    我有一个文档,内容类似于

    the line 1 is:
    a-b-o 
    the line 2 is:
    not found
    the line 3 is:
    not found
    the line 4 is:
    a-c-k
    the line 5 is:
    a-d-g
    a-h-o
    the line 6 is:
    a-g-i
    the line 7 is:
    not found

    这种。我想用python得到连续的有内容的那几行,而不是not found的那几行。以上面的为例,我想得到的结果是:

    the line 4 is:
    a-c-k
    the line 5 is:
    a-d-g
    a-h-o
    the line 6 is:
    a-g-i
    
    请问大家可以怎么实现,谢谢。
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部