"Beema shafreen" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
| hi all,
|           I have problem to sort the data.. the file includes data as
| follow.
| file:
| chrX:    123343123    123343182    A_16_P41787782
[snip]

| how do is sort the file based on the column 1 and 2 with values......
| using sort option works for only one column and not for the other how do 
is
| sort both 1 and 2nd column so that the third column does not change.....
| my script

If I understand correctly, the following untested version of your code 
should do what you ask.  Otherwise, you need to be more specific.

lis = []
fh = open('chromosome_location_346010.bed','r')
for line in fh.readlines():
    data = line.strip().split('\t')
    start = data[1].strip()
    end = data[2].strip()
    probe_id  = data[3].strip()
    lis.append((start,end),probe_id)

lis.sort()

tjr



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to