0

I'm new to python. I was playing around with the textract library to read commonly submitted files.

When I tried to extract data and print the results. I am facing an issue where "\n" shows up as "\n" instead of a new line. However, when I copy the result and print it in another python file, the result comes as expected. What mistake am I making?

This is my code -

import textract

def extractinfo(filename):
    info = textract.process(filename, encoding='ascii')
    info= str(info)
    print(info)
    filename = filename+".txt"
    file = open(filename, "a")
    file.write(str(info))

extractinfo("Secretary-Resume-Sample_Clean-Red.docx")
MAR
  • 1
  • 1

0 Answers0