Ask Your Question

Revision history [back]

If you want to use the csv module, you can specify that the delimiter is the tabulator as follows:

sage: reader=csv.reader(open(file), delimiter='\t')

then,

sage: L=[]
sage: for row in reader:                   
....:     L.append(row)
sage: L
[['pcb138', 'pcb180', 'pcb52', 'pcb118', 'pcb'],
 ['1.46', '0.738', '0.532', '0.72', '19.9959'],
 ['0.64', '0.664', '0.03', '0.236', '6.0996'],
 ['3.29', '1.15', '0.134', '1.54', '24.9655'],
 ['3.94', '1.33', '0.466', '1.94', '37.4436'],
 ['3.18', '2.14', '0.243', '1.47', '30.183'],
 ['2.43', '1.3', '', '0.137', '1.31', '20.8036'],
 ['3.94', '3.49', '0.208', '0.876', '41.3818'],
 ['3.38', '1.04', '0.477', '2.46', '29.478'],
 ['2.21', '0.966', '0.457', '1.14', '24.2387'],
 ['2.49', '1.59', '0.298', '1.18', '26.3198'],
 ['0.86', '0.395', '0.02', '0.406', '8.591'],
 ['3.38', '1.85', '0.539', '1.5', '', '36.4229'],
 ['7.39', '4.42', '0.707', '3.55', '66.4108']]
sage: L[1][0]
'1.46'