Skip to main content

kcat

Print the human-readable text extracted from each file, one block per line, regardless of the underlying format. A Word .docx, a JSON catalog and an XLIFF file all print as their plain prose, with the markup and structure stripped.

kcat [flags] [FILE...]

With no file, or when the file is -, standard input is read.

Examples​

# See the prose inside a Word document
kcat report.docx

# Number the blocks of a JSON catalog
kcat -n locales/en.json

# Print the French translations of an XLIFF file
kcat --target fr messages.xliff

# Pipe arbitrary text through, treating it as plain text
cat raw.txt | kcat -f plaintext

For byte-level line behaviour, pipe kcat output into the real grep, wc or sort. For block-aware search, use kgrep.

Options​

FlagMeaning
-n, --numberNumber the output blocks.
--idPrefix each block with its source ID.
-r, --recursiveRecurse into directory arguments.
--target LOCALEPrint the translation for LOCALE instead of the source.
-f, --formatOverride format detection (e.g. -f json).
--source-langSource language (default en).
--encodingInput encoding (default UTF-8).
--jsonEmit blocks as JSON instead of plain text.