cat had catdoc. bat gets batdoc.
batdoc dumps .doc, .docx, .xls, .xlsx, .pptx, and .pdf files to your terminal as markdown. To a tty it syntax-highlights and pages (using bat); piped, it gives you plain text.
.docx and .xlsx are parsed structurally from their XML — headings, bold/italic, lists, tables, and hyperlinks come through properly. Spreadsheets render as markdown tables, one ## section per sheet. Hyperlinks in all formats are rendered as [text](url) in markdown.
.doc is trickier. The binary format buries style info in structures we don’t fully parse, so markdown structure is inferred heuristically from the text: numbered headings, bold subheadings, tab-delimited tables. It works well on typical business documents; your mileage varies on weirder layouts.
.xls gets a full BIFF8 parser — SST with CONTINUE record boundaries, all the cell types (LABELSST, NUMBER, RK, MULRK, FORMULA, BOOLERR), hidden sheet filtering, encryption detection. It shares the same rendering path as .xlsx.
.pptx extracts text from all shapes on each slide. Font size is used to infer heading levels. Hyperlinks on text runs are resolved and rendered as markdown links. Multi-slide decks get ## Slide N headings.
.pdf extracts text from text-based PDFs using pdf-extract. Multi-page documents get ## Page N headings in markdown mode. Scanned/image-only PDFs that contain no extractable text get a clean error message. Malformed PDFs that would crash the underlying library are caught and reported as errors rather than panics.
This is free and open source software.
Website: github.com/daemonp/batdoc
Support:
Developer: Damon Petta
License: MIT License

batdoc is written in Rust. Learn Rust with our recommended free books and free tutorials.
Related Software
| Alternatives to cat | |
|---|---|
| bat | Super charged cat - Features in our Top 100 CLI Apps |
| mdcat | Sophisticated Markdown rendering for the terminal - Features in our Top 100 TUI Apps |
| grcat | Frontend for generic colouriser grc |
| tac | Concatenate and print files in reverse |
| ccat | Colorizing cat |
| see | Cute cat replacement |
| lolcat | Add some zest to the cat command. Features in our Linux Candy series |
| kat | cat command that almost tastes like chocolate |
| meow | Renders text using your existing Neovim configuration |
| mcat | Extended cat command |
| batdoc | cat for Office documents and PDFs |
| umber | Designed to replace cat for reading source code and other text files |
| rucat | Aimed at developers and system administrators |
| peek | Multi-buffer terminal pager |
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |

