Documents & OCRPractical guides

Word to TXT loses table relationships: verify blanks with a three-row case

Finding each number in TXT does not establish which table row owns it. This guide provides reusable building inputs for a three-row Word original, followed by extraction, ZIP inspection and a structured handoff: Pens is 12, Folders is not supplied and Tape is 2. Body, header and footer markers make the route’s scope checkable.

Interface wireframe sketches on paper with a black pen, illustrating text versus layout structure
Illustrative photo: Glen Carrie · Unsplash License

What changed: Added complete document-building inputs, body/header/footer markers, extraction ZIP checks, rebuilt CSV and a false-zero counterexample. The pack contains no prebuilt DOCX.

The practical answer

Keep the DOCX, choose Extract DOCX contents in Word tools, download docx-content.zip and reopen it. document.txt supports body-text lookup, not a universal table protocol. Compare the original cells to retain three records and a missing Folders count. Twelve plus two is a known subtotal of 14, not the complete total. Header/footer markers are outside this body extraction.

Identify what this entry actually delivers

Open the Word tool and choose DOCX content extraction. The current entry accepts DOCX and creates docx-content.zip: document.txt comes from the main document XML, with embedded media under images. It neither prints every visible page into its original layout nor performs OCR on each image.

Microsoft’s WordprocessingML table documentation distinguishes tables, rows and cells through structures such as tbl, tr and tc. Text is only part of that structure. Readable words after markup removal do not prove that those relationships remain.

Three objects with separate uses
ObjectUseful forBoundary or retention rule
Original DOCXInspecting layout, tables and other document partsPreserve it instead of overwriting it with a derivative
document.txtReading and finding extracted body textDoes not guarantee complete cell relationships, style or page layout
images directoryInspecting embedded media resourcesDoes not guarantee page-position mapping or perform image OCR

Three rows show why a blank cell matters

This is original, non-private editorial material. Create columns Item and Count, with three rows: Pens and 12; Folders and a blank; Tape and 2. Only Pens and Tape have supplied quantities. The blank means not supplied, rather than zero, and cannot borrow a value from the next row.

After extracting the DOCX, locate Item, Count, Pens, 12, Folders, Tape and 2. Finding them establishes text availability, not a table protocol in which every two lines form a record. Word permits multiple paragraphs in a cell, while blank cells can leave different forms of blank lines.

For a usable table, return to the source and record Pens=12, Folders=not supplied and Tape=2. The supplied quantities total 14, but that partial sum does not establish a complete total for all three items.

Original table and the meaning to preserve
ItemOriginal CountHandoff meaning
Pens12An explicit quantity is available
FoldersBlankNot supplied; do not silently insert zero
Tape2Belongs to Tape only

Text availability mistaken for a correct table

Misaligned route

Pair every two lines, discard blanks and let a later item or value shift into the Folders record.

Reviewable route

Reconstruct the three records from the original rows and columns, preserving the missing Folders quantity and checking Pens 12 and Tape 2.

Line breaks are not a universal cell-delimiting protocol.

Build and save a genuine DOCX before extracting

Create a small document containing one table, without images, comments or complex objects. Use the editor’s Insert table command for two columns and four rows including the header, rather than space-aligned plain text. Leave the Folders Count cell blank.

Put HEADER-ONLY-28 in the header, BODY-BEGIN-28 before the table, BODY-END-28 after it and FOOTER-ONLY-28 in the footer. Add a note that blank means not supplied and 12 + 2 = 14 is the known subtotal only. Save as source.docx and reopen it to check all three records and four markers. Editors may paginate or format differently; the facts must remain the same.

The “leave blank” table entry is an instruction: enter neither those words nor zero in the actual Count cell.

Complete table to create in Word
ItemCount
Pens12
Folders(leave blank, not zero)
Tape2

Begin with a small document and a distinct result directory

The exercise ZIP contains no prebuilt DOCX. It provides source-table.csv, source-definition.json, bilingual BUILD instructions, reconstructed.csv, wrong-zero.csv and expected.json. Build an original in your own Word-compatible editor using the complete building instructions, then reopen it to verify the markers and table. The CSV reference is manually reconstructed, not a claimed automatic table export.

This fixture contains no images, so docx-content.zip should contain only document.txt. A missing images directory is expected here. Media entries are produced for actual word/media resources in other inputs; this operation neither runs OCR nor returns a complete Word clone.

  1. Open Word tools, choose “Extract DOCX contents” and upload source.docx saved using the steps below. Do not choose Word to PDF or rename a CSV extension to DOCX.
  2. Process and download to a separate extraction ZIP, clearly distinguished from the exercise ZIP.
  3. Unpack the extraction ZIP and confirm document.txt is its sole file. Check both BODY markers and Item, Count, Pens, 12, Folders, Tape and 2 in the text.
  4. Search for HEADER-ONLY-28 and FOOTER-ONLY-28: neither should be in this TXT. Both are visible in the original DOCX, demonstrating why this is not an all-page-text export.
  5. Compare the original table and rebuild Item / Count / CountStatus: Pens / 12 / supplied; Folders / blank / not_supplied; Tape / 2 / supplied.
  6. Compare each row with reconstructed.csv. Then inspect wrong-zero.csv: even if both numeric sums give 14, replacing the missing Folders count with zero invents a fact.

Accept the three-row specimen

  • Pens owns 12 and Tape owns 2.
  • Folders remains explicitly not supplied.
  • Fixed two-line pairing has not replaced source-cell verification.
  • The partial sum 14 stays separate from the unknown complete total.
  • Original DOCX, extraction package and reconstructed table have distinct names.

Do not assume other document parts were included

The current route reads word/document.xml rather than traversing every header, footer or comment part. A document may also contain text boxes, revisions, embedded objects and other complex structures. Without checking each required part, do not label its output all text with nothing missing. Words inside scanned images do not become body text merely because their files appear in the media directory.

For the separate relationship between media and layout, see embedded Word images versus visible crops. If reviewed data must populate a document, use the Excel/CSV-to-Word template workflow and accept one output before creating a batch.

Retain materials for the next task

Body-text search

Keep TXT and source together; locate important matches in the original.

Page appearance

Use a layout-preserving route and inspect its pages separately.

Table calculation

Establish source rows, columns and missing-value rules rather than relying on plain text.

Readable extraction and complete extraction are different judgments

Legacy .doc, encrypted or damaged files may not work in this entry. A readable DOCX still does not establish preservation of every complex object. Establish behavior with a small specimen, then list unverified parts of the longer document. Processing is local to the browser; retain the original for later inspection.

This guide supplies reusable materials and acceptance checks, not a lossless-conversion promise for every Word version and document structure. For formal records or evidence, retain the original DOCX and the recipient’s requirements as the handoff basis. Use TXT only for verified purposes.

Base the handoff on the DOCX you actually saved and reopened, the actual extraction ZIP and the rebuilt table checked cell by cell. The exercise provides complete building inputs for reproduction in your own editor; pagination may differ. Complex objects, encrypted files and long documents need separate acceptance. A three-row fixture cannot establish lossless conversion for arbitrary Word files.

A subtotal of 14 can still accompany a wrong table

reconstructed.csv retains a blank Count and adds CountStatus to explain not supplied. That status is an explicit field created after human comparison, not meaning automatically inferred by the extractor. Define the added field for the recipient so a deliberate missing value is not mistaken for an export defect.

wrong-zero.csv deliberately changes Folders to 0 and its status to supplied. It still contains three records and its numeric sum is still 14. Row count plus total therefore misses this error. Compare the Folders source cell and missing-value state instead. Preserve not supplied and seek the missing information; do not borrow another row’s value or fill zero for convenience.

When TXT order or provenance is unclear, stop pairing a fixed number of lines and rebuild from the DOCX. Without the original, hand over only the identifiable text and the incomplete-review note, not an invented complete table. Retain the DOCX, actual extraction ZIP, manually reconstructed CSV and review note. Downloading the exercise or completing extraction alone does not establish those checks.

What each independent control can establish
ControlCorrect referenceFalse-zero copyDistinguishes them
Data records33No
Known numeric subtotal1414No
Folders source and statusBlank / not_supplied0 / suppliedYes, by source-cell review
Complete three-item totalUnknownMisstated as 14A subtotal is insufficient

Common questions

Can I turn every blank into zero to make summing easier?

Only if the task explicitly defines blank as zero. Here it means not supplied, and inserting zero would add a fact absent from the source.

Can clean line breaks restore a table by fixed line counts?

Not generally. A cell can contain several paragraphs or be empty. The original table or an explicit structured delimiter protocol is needed to establish column relationships.

Must the archive image count match visible image occurrences?

No. Media resources and page references are different objects. A resource may be referenced repeatedly or remain unused; inspect the original document.

Further reading & sources

Put the guide into practice

Open the relevant tool, preview the result and check your exported file.

Related articles