我需要在行之間提取文本行並將其填充到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