Using Fetlar
Many files at once
Convert a folder or a list of files in one command, on all cores.
Give Fetlar several files, or a folder, and an output folder with -o.
fetlar reports/ -o out/
fetlar a.docx b.xlsx c.pptx -t json -o out/
find . -name '*.docx' -print0 | xargs -0 fetlar -t text -o out/Running the first command on a folder with three files:
$ fetlar docs/ -o out/
$ ls out
budget-v1.md
contract-v1.md
supply-ar.mdHow it works
- A folder means the Office files directly in it. Subfolders are not searched. Hidden files and
~$lock files are left out. Files named on the command line are always tried. - Each input becomes one output file named after it, with the format's extension:
report.docxbecomesreport.md,report.txtorreport.json. - Two inputs with the same name (
report.docxandreport.xlsx) keep their extension:report.docx.mdandreport.xlsx.md. - The output folder is created if it does not exist.
- Files are converted at the same time, one per core, largest first. Each output is exactly what
fetlar FILEwould print. - A folder given to Fetlar converts Office files only. CSV, TSV and HTML files must be named on the command line.
Errors
If one file fails, the others are still converted. Each error goes to stderr, starting with the file's path. At the end Fetlar counts the failed files.
The exit code is 0 when every file converted. Otherwise it is the code of the first failed input, in the order you gave them. See Exit codes.
Several inputs without -o is a usage error (exit code 2).
Threads
FETLAR_THREADS=N limits how many threads Fetlar uses. FETLAR_THREADS=1 reads one file and one sheet at a time and uses the least memory. The output is the same either way.