Is there any API could convert perfectly doc file(only .doc) to txt file? I want to use it in python on Centos. Free or not free are both fine.
Is there any API could convert perfectly doc file(only .doc) to txt file? I want to use it in python on Centos. Free or not free are both fine.
2
Answers
You can use Aspose.Words to do the conversion. Unfortunately there is no Python version, however you can use Aspose.Words for Java in conjunction with JCC
https://docs.aspose.com/display/wordsjava/How+to+build+Aspose.Words+for+Python+via+Java
Or you can simply use Aspose.Words for Cloud https://products.aspose.cloud/words/python
Convert .doc file to .docx
from pathlib import Path
p = Path("filename.doc")
p.rename(p.with_suffix(‘.docx’)
Then use docx2txt to convert .docx file to text