-1
我想知道如何使用Python或任何其他编程/脚本语言来格式化文本文件?如何使用Python或任何其他编程/脚本语言来格式化文本文件?
在文本文件中目前的格式是这样的:
ABALONE
Ab`a*lo"ne, n. (Zoöl.)
Defn: A univalve mollusk of the genus Haliotis. The shell is lined
with mother-of-pearl, and used for ornamental purposes; the sea-ear.
Several large species are found on the coast of California, clinging
closely to the rocks.
我希望它是这样的(全部在一行排除一些单词等):
ABALONE : A univalve mollusk of the genus Haliotis. The shell is lined with
你试过了什么? – Cfreak 2013-02-08 15:28:49
将第一段文本转换为第二段文字的规则是什么?在Python中操作字符串相对比较简单,你试过什么,什么不行? – 2013-02-08 15:29:29
与http://docs.python.org/3/tutorial/index.html – 2013-02-08 15:30:12