I'm using python to merge two files together to create a new one, the data in both files have an id at the start of every string which I want to sort so they're both in the same order and can be merged. To do this I've used .sort() so that they're both arranged in the same order and the comments match the details. However, I'd now like to reorder them so that they go 1, 2, 3, 4... instead of 1, 10, 100, 1000, 1001, 1002 etc but I am having difficulties since the number is the start of a string and python wont convert the first four characters of a string to an integer. If it is any help it is also a tab delimited file and the next piece of information after the id is the date.

Any ideas would be appreciated and ideally I would not like to import any libraries. 

My code is:

```
comments = R'C:\Pythonfile\UFOGB_Comments.txt'
details = R'C:\Pythonfile\UFOGB_Details.txt'
mydest = R'C:\Pythonfile\UFOGB_sorted.txt'

with open(details,'rt') as src:
    readdetails = src.readlines()
    readdetails.sort()

with open(comments,'rt') as src:
    readcomments = src.readlines()
    readcomments.sort()

with open(mydest, 'w') as dest:
    for i in range(len(readdetails)):
        cutcomm = readcomments[i][readcomments[i].find('"'):]
        dest.write('{}\t{}'.format(readdetails[i].strip('\n'),cutcomm))

```