I have a tab delimited data that looks like this:
Probes FOO BAR
1452463_x_at 306.564 185.705
1439374_x_at 393.742 330.495
1426392_a_at 269.850 209.931
1433432_x_at 636.145 487.012
1415687_a_at 231.547 175.008
1424736_at 248.926 189.500
1435324_x_at 244.901 225.842
1438688_at 180.511 187.407
1426906_at 206.694 218.913
What I want to do is to parse the above data. But first will have to skip the line that starts with Probes
. But why this line failed? What is the most common Pythonesque way to deal with these problem?
import sys
import csv
import re
with open('Z100_data.txt','r') as tsvfile:
tabreader = csv.reader(tsvfile,delimiter='\t')
for row in tabreader:
if re.match("^Probes",row):
# He we try to skip the first line.
continue
else:
print ', '.join(row)