I have a text file (tab delimeted) and I would like to pass field 1 in a list (list1) and field 3 in another list (list2) using list comprehension.
The code I wrote is this:
with open (path) as file1:
list1 = [line.strip().split('\t')[0] for line in file1];
list2 = [line.strip().split('\t')[3] for line in file1];
The problem is that list2 stays empty.
Any thoughts why this is happening?
Thanks!