Проблема в вашем коде в том, что вы не открываете файлы для чтения.
Попробуйте это:
from os import listdir
from os.path import isfile, join
folder_path = 'E:\\Project\\tests'
# get the full names of all the txt files in your folder
files = [join(folder_path, f) for f in listdir(folder_path) if isfile(join(folder_path, f)) and f.endswith(".txt")]
f = open('outputFile.txt', 'a')
for file in files:
line = open(file,"r").readlines()[1] # line will be equal to the second line of the file
f.write(line + '\n')
f.close()