Hi, I am trying to convert thousands of rtf docs to txt by passing the folder info. I keep getting file “Error: source file could not be loaded”
When I pass single file, it works.
Here is the code that I use to pass folder and get an error.:
d = tempfile.mkdtemp()
subprocess.run([‘soffice’, ‘-env:UserInstallation=file://’+d, ‘–headless’, ‘–convert-to’, ‘txt’, ‘/home/oe/DesktopAudioFiles/Test/*.rtf’’, ‘–outdir’, directory_list ])
When I try it with file :
d = tempfile.mkdtemp()
subprocess.run([‘soffice’, ‘-env:UserInstallation=file://’+d, ‘–headless’, ‘–convert-to’, ‘txt’, ‘/home/oe/DesktopAudioFiles/Test/1.rtf’’, ‘–outdir’, directory_list ])
I am trying to understand why I cannot pass wildcards as a name.
Second question is, when I use individual names and parallelize it with python multiprocessing, it hangs in the middle of the process, no error just hangs. Anyone has a suggestion regarding how to convert rtf to txt as fast as possible.
Thank you,