To state the obvious, the values are not integers and some have multiple groups of digits and so creation of the required integer requires a more precise specification.
Could you provide the integer values you want returned for the above?
Or do you want to catch the exception and handle these invalid columns differently?
I am at a loss here.
Is it a string representation of the _numbers_ part?
If so then does that include the "." which makes that part a float?
What about the "-", (minus in this case; NOT hyphen), is that needed?
OR...
Is it a numerical representation of each ASCII character, "ord()" for example.
Lastly your <title> is the opposite of what your <text body> says.
Which is it?
Please give us more to go on...
Python version, machine, OS, etc...
EDIT:
BTW Python has had a wonderful traceback system ever since I first started exerimenting with it at version 1.4.0...
there's no need to convert to int unless you want to do some mathematics on those columns. Your column contains letters. What are you actually trying to do with that column?
from collections import defaultdict
import sys
d = defaultdict(list)
with open (sys.argv[1]) as f:
for line in f:
line_data = line.strip().split()
d[' '.join(line_data[0:5])].append(line_data[5])
for k in sorted(d.keys(), key = lambda s: (s.split()[0], int(s.split()[1]))):
print(k, ', '.join(d[k]))