次の例は、正規表現に依存する David のものよりもややエレガントではありませんが、透過的です。あなたが説明した特定のフォーマットに強く依存しています。また、実際には、関心のある変数が 6 つ (5 つではなく) あるように思われます。読み取りの比率を小数に変換できない場合を除きます。
nameList にファイル名の正しいリストを指定する必要があります (便利な方法で名前が付けられていない場合は、手動で)。
また、エクセルファイルではなくcsvに出力しています。もちろん、Excel で csv ファイルを開くのは非常に簡単で、そこから xls として保存できます。
コメントに応じて編集 (05/19/13):フルパスを含めるのは簡単です。
import csv
import string
# Make list of all 20 files like so:
nameList = ['/full/path/to/Log.txt', '/different/path/to/Log.txt', '/yet/another/path/to/Log.txt']
lineNum = 68
myCols = ['nodes','n50','max','total','reads1','reads2']
myData = []
for name in nameList:
fi = open(name,"r")
table = string.maketrans("","")
# split line lineNum into list of strings
strings = fi.readlines()[lineNum-1].split()
# remove punctuation appropriately
nodes = int(strings[3])
n50 = int(strings[8].translate(table,string.punctuation))
myMax = int(strings[10].translate(table,string.punctuation))
total = int(strings[12].translate(table,string.punctuation))
reads1 = int(strings[14].split('/')[0])
reads2 = int(strings[14].split('/')[1])
myData.append([nodes, n50, myMax, total, reads1, reads2])
# Write the data out to a new csv file
fileOut = "out.csv"
csvFileOut = open(fileOut,"w")
myWriter = csv.writer(csvFileOut)
myWriter.writerow(myCols)
for line in myData:
myWriter.writerow(line)
csvFileOut.close()