I have a set of text files in a folder. I want to read each file, convert the contents of the file to lowercase, remove punctuations and save them all in another directory with the same filenames. How can i do that???
Here's another bit of code that will give you part of the solution:
dirpath = '/the/directory/path' # or maybe r'D:\the\directory\path'
for item in os.listdir(dirpath):
p = os.path.join(dirpath,item)
desc = 'file'
desc = 'folder'
desc += ' (link)'
print("I found a %s: %s"%(desc,p))