I have a text in a file with multiple lines. I would like to create one big list, with each line as a seperate list inside. Within these lists each word should be a string. This is my code at the moment, I am failling to split the strings within the lists.
f = open("test.txt","r") for line in f.readlines(): line2= line.split(",") print(line2) f.close() This is the output:
['Das ist 1e\n'] ['Textdatei', '\n'] ['bestehend aus mehreren Wörtern.']