I have the following:
line = ['aaaa, 1111, BOB, 7777','aaaa, 1111, BOB, 8888','aaaa, 1111, larry, 7777',,'aaaa, 1111, Steve, 8888','BBBB, 2222, BOB, 7777']
Is there away I can sort by (Bob,Larry,Steve) then by (1111,2222)?
so...
for i in line:
i = i.split(' ')
pos1 = i[0]
pos2 = i[1]
pos3 = i[2]
pos4 = i[3]
So I need to sort by pos3 and then by pos2.
Desired output would be:
'aaaa, 1111, BOB, 7777'
'aaaa, 1111, BOB, 8888'
'BBBB, 2222, BOB, 7777'
'aaaa, 1111, larry, 7777'
'aaaa, 1111, Steve, 8888'