annotate Iterative_mapping/read_file.py @ 0:d56631911cc1 draft

Uploaded
author tyty
date Mon, 15 Sep 2014 14:41:13 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d56631911cc1 Uploaded
tyty
parents:
diff changeset
1 #!/usr/bin/env python
d56631911cc1 Uploaded
tyty
parents:
diff changeset
2 # -*- coding: utf-8 -*-
d56631911cc1 Uploaded
tyty
parents:
diff changeset
3
d56631911cc1 Uploaded
tyty
parents:
diff changeset
4 import sys
d56631911cc1 Uploaded
tyty
parents:
diff changeset
5
d56631911cc1 Uploaded
tyty
parents:
diff changeset
6
d56631911cc1 Uploaded
tyty
parents:
diff changeset
7
d56631911cc1 Uploaded
tyty
parents:
diff changeset
8 def read_t_file(in_file):
d56631911cc1 Uploaded
tyty
parents:
diff changeset
9 f = open(in_file);
d56631911cc1 Uploaded
tyty
parents:
diff changeset
10 result = [];
d56631911cc1 Uploaded
tyty
parents:
diff changeset
11 for aline in f.readlines():
d56631911cc1 Uploaded
tyty
parents:
diff changeset
12 temp = [];
d56631911cc1 Uploaded
tyty
parents:
diff changeset
13 tline = aline.strip();
d56631911cc1 Uploaded
tyty
parents:
diff changeset
14 tl = tline.split('\t');
d56631911cc1 Uploaded
tyty
parents:
diff changeset
15 for i in range(0, len(tl)):
d56631911cc1 Uploaded
tyty
parents:
diff changeset
16 temp.append(tl[i].strip());
d56631911cc1 Uploaded
tyty
parents:
diff changeset
17 result.append(temp);
d56631911cc1 Uploaded
tyty
parents:
diff changeset
18 f.close();
d56631911cc1 Uploaded
tyty
parents:
diff changeset
19 return result;
d56631911cc1 Uploaded
tyty
parents:
diff changeset
20
d56631911cc1 Uploaded
tyty
parents:
diff changeset
21