def file_index(index):
    """
    formatting the index of each file to make it into a four digit string
    for example, if the index is 1, it will beoomes '0001'. If the index is 100, it will become '0100'
    """
    if len(str(index)) == 1:
        return '000' + str(index)
    elif len(str(index)) == 2:
        return '00' + str(index)
    elif len(str(index)) == 3:
        return '0' + str(index)
    elif len(str(index)) == 4:
        return str(index)