The scanned table has merged headers. How to restore the structure after recognition?

After the scanned form is recognized as Excel, the header of the merged table is often misplaced or dismantled. This article explains how to first determine whether the problem is identification or export, and then restore the structure by splitting headers, completing groups, and checking column by column, and provides preventive measures.

Key points of this article

  • Recognition of merged headers fails. Most likely, cross-column headers are treated as single-frame text, or grouped rows are not recognized as independent rows.
  • First confirm whether the scanned document is clear and whether the text can be selected, and then decide whether to re-recognize it or correct it manually.
  • Split the multi-layer header into "group rows" and "field rows", fill in the blank groups in Excel, and then rebuild the merge grid based on the original table.
  • It is easy for OCR to make mistakes in decimal points, commas or total lines of numbers. After exporting, you must check the original image column by column.

Many people have a scanned quotation, experimental record or financial statement and want to convert it to Excel to continue calculations. The data part of the table is usually still usable, but the merged table header at the top is messed up: the large titles spanning several columns are squeezed into one grid, the group names below are moved to other rows, and the entire table looks like it has been dismantled. This type of problem is especially common in scanned documents, because the merged cells do not have clear cell boundaries, and it is difficult to determine which words belong to the same title during recognition.

If you search online for "How to set up table recognition retention format", you will mostly get general instructions, such as selecting the export format, checking the retention format, etc. These settings can solve most common table problems, but when it comes to multi-layer merge headers, settings alone are often not enough. This article only talks about this difficult point: how to restore the structure of the merged header step by step after identification.

After reading this article, you can first determine which layer the error is located on, then follow the steps to correct the header, and finally use a set of inspection methods to confirm that the data is not misaligned. The following method is based on the desktop client's PDF editor (which supports OCR for scanned PDFs and exporting to Excel). It is also applicable to the recognition and export of scanned PDFs on omnidoc.top.

After the merge header recognition is messed up, how to restore the structure? One sentence conclusion

Conclusion in one sentence: First split the table header in the recognition result into two or three clear lines, complete the split group names, then reconstruct the merged grid according to the original table in Excel, and finally check the data column by column.

your situationRecommended practicesreason
The table has a complete outline and only the top row incorporates the titleExport to Excel directly after OCR, and then merge the cells where the title is locatedIt is easier to identify the structure when there is a frame, and usually only the title position needs to be corrected.
Multi-layer header, the upper layer spans multiple columns, and the lower layer is specific fieldsSplit into two lines: "grouping row" and "field row", complete the group name and then mergeAfter the merged grid is split, the levels can only be aligned manually.
Table without borders, align columns by whitespaceFirst check the alignment of the columns and manually adjust the column positions if necessary.Without lines, there is no basis for classification. You need to refer to the alignment of the original image.
Scans are skewed, blurred, or have shadowsRe-scan or correct the photo first, then do OCRThe quality of the image before recognition directly determines whether the header text can be read accurately.
The table spans two pages, and the header only appears on the first pageAfter exporting, add headers to each segment and then merge the data.The table header will not be automatically repeated when crossing pages, and column names will be missing after merging.

First determine what kind of problem it is

The table below can help you compare the phenomena and causes. Make a clear judgment before deciding where to repair.

SymptomsCommon causesHow to confirm this
Merge titles into a single field, with text packed into one spaceOCR treats inter-column text as single-cell contentIn Excel, check if the title is in the left section and the right few spaces are empty
The upper group name disappears or is incorrectly moved to the next linePacket rows are not recognized as independent rowsCompare with the original image and count the row of the grouped text
A column of data is shifted to the right or misalignedMissing blank columns or vertical lines is detectedSelect the data area and compare it to the position of the first data item in the original table
Numbers have extra spaces, commas, or missing decimal pointsThe characters were misidentifiedSpot check a few panels and compare them one by one with the original image
The total bank has mixed in the detailed dataIf the spacing between the total line and the detailed line is too small, it will be recognized as the same lineCheck whether the total text is on the last line in the data area

Inspect and fix each item one by one

Follow the steps below: first eliminate issues at the recognition level, then handle the header structure, and finally verify the data.

  1. Open the scanned PDF in the desktop client and try selecting a passage from the table with your mouse. If you can't select it, it means the page is just an image and you need to do OCR first.
  2. Perform OCR on this page, then select the table header again and confirm it is selectable. If selected, the description layer has been generated.
  3. Export the page as Excel. If only a few squares are misaligned, proceed to step 4; If the entire table is completely out of order, first return to step 1 to check whether the scan is clear and if a re-scanning is needed.
  4. In Excel, locate the header area of the table. Don't rush to merge cells; clearly read the upper group text and the lower field text separately, and note which column they belong to.
  5. Split the multi-layer header into two or three rows: the first row for group names, the second row for field names. Where the merge grid is split, fill in the left or upper content.
  6. Merge the corresponding cells in Excel according to the original table's grouping relationships, aligning the header with all columns it covers. Finally, check the original diagrams to ensure the merging scope matches.

What to do if the multi-layer meter header is completely misaligned

If the table header has more than three layers, or if the upper group spans are inconsistent, frame by frame modification will be time-consuming. At this point, it's recommended to create a separate worksheet in Excel and write out the full path of each column in text, for example: "Sales - East China - Quantity." After confirming the paths are correct, replace the column headers of the original data table with these paths, and finally reformat as needed. This way, even if merging cells are lost, the data ownership will not be wrong.

What to do if the scanned copy itself is unclear?

If a large number of text errors or hyphenation occur after OCR, the problem usually lies in scanning quality. It is recommended to flatten the page and increase resolution when rescanning to prevent shadows from pressing on the table line. If the scanned document cannot be rescanned, you can first identify only the header area and leave the data area verification process last. In either case, OCR results require manual verification, especially for important details such as amount, date, and serial number.

How to Prevent It from Happening Next Time

  • Before scanning, lay the page flat; if you close it, it will cover the shadows of the table lines. When scanning or shooting, try to face the page directly.
  • For multi-layer tables, before exporting, confirm in the PDF that each grouped text is selected, then proceed with subsequent processing.
  • In Excel, first split the table header into standard field rows, then consider merging grids. Data analysis, filtering, and formulas all rely on standardized field rows; merging too early can cause errors in subsequent operations.
  • For tables of the same type, a fixed header structure is recorded, so the same format can be applied directly next time it encounters, reducing redundant checks.
  • The numeric column and total row need to be checked separately; don't just use the header to check if it's correct.

❓ Frequently Asked Questions (FAQ)

1. Can a table without borders be converted to Excel?

Yes, but the result depends more on column alignment. After recognition, first check whether the starting position of each column matches the original image, then verify the data column by column.

2. Does the merge header have to be restored to the merge grid?

Not necessarily. If the subsequent work is only for calculation or pivot, breaking the header into complete field names is usually more convenient; If you need to print it as is or give it to someone else to read, then restore and merge the grids accordingly, it is more appropriate.

3. What should I do if the number keeps getting wrong after recognition?

First, confirm whether the scanned image is clear, then randomly check a few frames to compare with the original. OCR is sensitive to decimal points, commas, and similar characters; important numbers need to be manually checked one by one, so recognition results alone cannot be relied upon.

4. How do you handle table headers in tables with spans?

After exporting, add a complete header above each data segment, then merge it into one table. Before merging, check whether there are duplicate total rows between two pages to avoid duplicate data calculations.

📝 Summary

After merging header recognition, the confusion is mostly because cross-column headers and grouped rows were not properly split during OCR. First, determine whether the problem is identified or exported, then split the table header into clear field rows, and finally rebuild the merge cells according to the original table and check them column by column to restore the structure.

Open OmniDoc to identify and translate the scan

Updated 2026-11-11