

# https://www.globalsino.com/ICs/page4853.html
# Sort a txt file


MyList = list()

filename = 'C:\GlobalSino\images\TestImages\Excel\TestList.txt'
with open (filename) as TheFile:
    for line in TheFile:
        MyList.append(line.strip())

MyList.sort()

Sorted_FileName = 'C:\GlobalSino\images\TestImages\Excel\Sorted_TestList.txt'
with open(Sorted_FileName, 'w') as My_sorted_file:
    for My_sorted in MyList:
        My_sorted_file.write(My_sorted + '\n')







