【发布时间】:2023-03-19 06:45:01
【问题描述】:
我的文本文件中有一些块。我假设通过下面的块来构造我的文本
如何通过关键字读取块。(keyword1,keyword2,keyword3,keyword4)。
我有两个问题。
1、有没有什么方法可以有效的取出每个关键词的下一行?
2.不知道keyword3和keyword4之间的内部空行怎么跳转。关键点是定义的块以空白结尾。
**block start**
Keyword1
Single Line # I need work on the line
Keyword2
Single or Multiple lines # I need work on the lines
Keyword3
(May be there is single or multiple Blank lines)
Single or Multiple lines # I need work on the lines
(May be there is single or multiple Blank lines)
Keyword4
Single or Multiple lines # I need work on the lines
Single or multiple Blank line
**block end**
【问题讨论】:
标签: perl parsing text-parsing