tsv file seperation

43 views
Skip to first unread message

yinx

unread,
Nov 20, 2015, 9:32:04 AM11/20/15
to Python GCU Forum
Hi, Im having difficulty with python.
I have a tsv file, with two columns and a lot of rows. one of the column gives the sample number and the other column the results. I want to seperate them in a new file by the same results, How do I do this?
Do i need to turn the file into a dictionary first?

example:
 sample 1   5
 sample 2   7
 sample 3   8
 sample 4   5
 sample 5   7

output will look like:
file 1
 sample 1  5
 sample 4  5
file 2
 sample 2  7
 sample 2  7

Thank you, appreciate it!


Reply all
Reply to author
Forward
0 new messages