Extract Text
Writes the text of each PDF, Word, Excel, PowerPoint, email, RTF, HTML or text file to its own UTF-8 .txt file, and reports documents that need OCR or cannot be read.
Extract Text reads each document in the input folder and writes its text to a .txt file in the run folder, keeping the folder structure. The original extension stays in the name (report.docx.txt, report.pdf.txt), so documents with the same name but different types never overwrite each other. It reads the modern Office formats and also Word, Excel and PowerPoint 97-2003 files (.doc, .xls, .ppt) directly; Microsoft Office is not needed.
The text includes more than the main body. For PDFs it includes annotations and form fields. For Word it includes headers, footers, footnotes, comments and tracked deletions. For Excel it covers every sheet, hidden sheets included, with each row on one tab-separated line. For PowerPoint it includes speaker notes. For emails it gives the subject, sender, recipients, attachment names and body. Every file is reported: scanned PDFs, password-protected files and unsupported types are listed with a reason, never skipped silently.
Use it when
- You need extracted text to go with a production, for example a
TEXTfolder for a load file. - A review platform or analytics tool needs plain text for each document.
- You want to find out which PDFs are scans that need OCR before a production or search.
How to run it
- Choose the folder of documents as Input.
- Choose an Output folder outside the input folder.
- Leave location-headers on to mark pages, sheets and slides in the text, or turn it off for plain text only.
- Click Run and read the notes for counts of documents that need OCR or could not be read.
- Click Open report and filter the Status column.
- Run OCR on any PDFs reported as needing it, then run Extract Text again on the OCR output.
Settings
Every setting has the same help beside it in the app. On the command line, pass each as --name value; ltk help extract-text lists them.
Settings
| Setting | What it does | Type and default |
|---|---|---|
Location headers--location-headers |
Mark where text came from inside each text file: page, sheet and slide headings (===== Page 3 =====) and labels such as [Comment B7]. Off: the text only. When on, the text file has headings such as ===== Page 3 =====, ===== Sheet: Ledger ===== or ===== Slide 2 =====, and labels such as [Comment B7], [Tracked deletion], [Annotation] and [Notes]. Turn it off when the text is going into a system that expects only the document's own words. Email field labels (Subject, From) are kept either way. |
yes/notrue |
Common settings
| Setting | What it does | Type and default |
|---|---|---|
Input required--input |
Folder (or single file) to read. It is opened read-only and never modified. | folder empty |
Output required--output |
Folder for reports. Must not be inside the input folder. Each run gets its own sub-folder. | folder empty |
Recurse--recurse |
Include sub-folders. | yes/notrue |
Extensions--extensions |
Only process these extensions (e.g. .pdf, .docx). Empty means the tool's default set. | list empty |
Parallelism--parallelism |
Files processed at once. Use 1-2 for spinning disks or network shares. | number4 |
What you get
Each run creates its own folder inside the output folder, with the report extract-text.csv, errors.csv and manifest.json (see Run folders and manifests).
files\…\report.pdf.txt: One UTF-8 text file per readable document (with a byte order mark and Windows line endings), in the same folder structure as the input.extract-text.csv: One row per document: the number of Characters, the Status, Details of anything worth knowing, the Destination of the text file and its SHA-256.errors.csv: Files that failed outright, such as a damaged PDF.
Report columns
RelativePathFileNameCharactersStatusDetailsDestinationOutputSHA256SourcePath
Check the result
- Filter Status for
No text: needs OCR(no text file is written) andPartly extracted: pages need OCR(the Details column lists the pages without text). - Filter Status for
Not supported: password-protected files and file types with no extractable text. The Details column gives the reason. - Read Details for emails: attachments are not extracted, only their names. Use Extract Attachments and run this tool on the extracted files.
- Check
errors.csvand look at a few text files to confirm the content is what you expect.
- Excel cells give their saved values. A formula is shown only when the cell has no saved value.
- For Word 97-2003 files, fields give their saved results (a date, for example), not the field codes.
- Emails with no file extension are picked up automatically when extensions is left empty.
- The same input always produces exactly the same text files, with the same hashes.
- A character count of zero, or a much lower count than expected, usually means the document is a scan. Check the Status column rather than assuming the document is blank.
- Password-protected files are not extracted. Remove the passwords with Decryption first, then extract from the unlocked copies.
- Text from tracked deletions, comments and hidden sheets is included and labelled. If the text is going to another party, consider whether that content should be there.
From the command line
The command line is part of LitTechKit Pro. See Command line.
ltk run extract-text --input "D:\Matter\Production 1\NATIVES" --output "D:\Matter\Production 1\Text" --location-headers false
Related tools
- OCR (Searchable PDFs): Makes scanned PDFs and images (TIFF, JPEG, PNG) searchable with Windows' built-in OCR: an invisible text layer is added over each scanned page, so it looks the same but can be searched, selected and extracted. Pages that already have text are left alone. Images become PDFs. Works offline.
- Decryption: Removes known passwords from PDF, Word, Excel and PowerPoint files, writing unlocked copies and reporting which password number opened each file (the passwords themselves are never saved). Encrypted .docx/.xlsx/.pptx files are decrypted without Office, so the unlocked copy is the original document exactly.
- Extract Attachments: Extracts attachments (and attached emails, recursively) from .msg and .eml files into a new folder, with family IDs, verified hashes and safe file names.
- Create Load File: Creates a Concordance DAT and Opticon OPT load file for a production folder, grouping natives, images and text by Bates number.