I need to read through lines in multiple files; the first value in each line is the runtime, the third is the job id, and the fourth is the status. I have created lists to store each of these values. Now I'm not understanding how to connect all of these lists and sort them based on the lines with the top 20 fastest runtimes. Does anybody have a suggestion for how I can do that? Thank you!
for filePath in glob.glob(os.path.join(path1, '*.gz')):
with gzip.open(filePath, 'rt', newline="") as file:
reader = csv.reader(file)
for line in file:
for row in reader:
runTime = row[0]
ID = row[2]
eventType = row[3]
jobList.append(ID)
timeList.append(runTime)
eventList.append(eventType)
jobList = sorted(set(jobList))
counter = len(jobList)
print ("There are %s unique jobs." % (counter))
i = 1
while i < 21:
print("#%s\t%s\t%s\t%s" % (i, timeList[i], jobList[i], eventList[i]))
i = i + 1