adding padding function for text files