I have a tab separated txt file (file.txt) which looks like this:
Barcode1 ID644 79
Barcode2 ID232 80
Barcode3 ID008 09
I would like to convert it to list of list:
Expected output:
[[Barcode1], [ID644], [79]]
[[Barcode2], [ID232], [80]]
[[Barcode3], [ID008], [09]]
I tried this:
table_file=open("/Users/file.txt","r")
listID=[]
for line in table_file:
line = line.strip('').split('\t')
listID.append(line)
However I got something like this for the first line:
['Barcode1', 'ID644', '79\n'] ....
Any advice?