我有一個(gè)文檔,內(nèi)容類似于
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得到連續(xù)的有內(nèi)容的那幾行,而不是not found的那幾行。以上面的為例,我想得到的結(jié)果是:
the line 4 is:
a-c-k
the line 5 is:
a-d-g
a-h-o
the line 6 is:
a-g-i
請(qǐng)問(wèn)大家可以怎么實(shí)現(xiàn),謝謝。
用python查找連續(xù)行
慕運(yùn)維8079593
2019-02-23 19:05:36