我需要在行之间提取文本行并将其填充到excel文件中。有行数之间的差异,但他们已经开始与 评论备案“IDNO” ......等文字相同行之间的文本提取
__DATA__ (This is what my .txt file looks like)
Comment for the record "id1"
Attempt1 made on [time] outcome [outcome]
note 1
Comment for the record "id2"
Attempt1 made on [time] outcome [outcome]
note 1
Attempt2 made on [time] outcome [outcome]
note 2
Comment for the record "id3"
Attempt1 made on [time] outcome [outcome]
note 1
Attempt2 made on [time] outcome [outcome]
note 2
Attempt3 made on [time] outcome [outcome]
note 3
Attempt4 made on [time] outcome [outcome]
note 4
的字符串希望这显示
id1 Attempt1 Note1 [outcome]
id2 Attempt1 Note1 [outcome]
id2 Attempt2 Note2 [outcome]
id3 Attempt1 Note1 [outcome]
id3 Attempt2 Note2 [outcome]
id3 Attempt3 Note3 [outcome]
id3 Attempt4 Note4 [outcome]
结果值将改变并且将是2-3位数字代码。
任何帮助将不胜感激。我在最后一天或2天浏览过这个网站,但由于我的经验有限,我无法找到相关的东西,而且我是相当新的perl,shell认为将它作为一个问题发布会更好。
类方面, 王牌
CPAN也有一个简单的Excel模块,可能对此很有用。 – Sorpigal