【发布时间】:2009-10-24 10:41:28
【问题描述】:
文件1:
hello
- dictionary definitions:
hi
hello
hallo
greetings
salutations
no more hello for you
-
world
- dictionary definitions:
universe
everything
the globe
the biggest tree
planet
cess pool of organic life
-
我需要将它(对于大量单词)格式化为术语到定义格式(每个术语一行)。怎么能做到这一点?没有一个词是相同的,只有上面看到的结构是相同的。生成的文件如下所示:
hello - dictionary definitions: hi hello hallo greetings salutations no more hello for you -
world - dictionary definitions: universe everything the globe the biggest tree planet cess pool of organic life -
Awk/Sed/Grep/Cat 是通常的竞争者。
【问题讨论】:
-
将问题更改为更具体的脚本语言/命令。