【发布时间】:2016-01-21 19:59:24
【问题描述】:
我需要根据每个段落中使用的文件名按字母顺序对段落进行排序。这是一个示例(文本文件中大约有 200 个这样的段落):
------------------------------------------------------------------
L:hwqw\se\hf8594.txt
File Creation Date: September 07, 2004
Identifier #: hf8594.tif
Image Pixels (meters): 1.25
Format: 8 bit TIFF
------------------------------------------------------------------
L:hhtk\ha8421.txt
File Creation Date: September 07, 2004
Identifier #: ha8421.tif
Image Pixels (meters): 1.25
Format: 8 bit TIFF
现在我需要根据Identifier #对段落进行排序(标识符与顶部的文本文件同名,但文本文件在不同的子文件夹中,所以我认为使用标识符会更好)。
【问题讨论】:
-
好吧,我什至不知道如何开始,因为我是 Python 初学者
-
是的,我认为初学者的问题没有错。
标签: python sorting text-files paragraph