Skip to content
Back to skills

Extract Tables From Pdf

ASecurity

Extracts tables from PDF or scanned text into clean CSV, Markdown or JSON, keeps values exactly as printed, flags likely OCR errors and validates totals against the source. Use before analysis.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 26, 2026
ai-agentsgogit

Security analysis

A100/100

Scanned November 26, 2026

npx -y skills add hermes-hq/hodios-dist --skill extract-tables-from-pdf --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Extract Tables From Pdf?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Extract Tables From Pdf
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hermes-hq-extract-tables-from-pdf/badge)](https://www.skillsdirectory.com/skills/hermes-hq-extract-tables-from-pdf)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: extract-tables-from-pdf
description: Extracts tables from PDF or scanned text into clean CSV, Markdown or JSON, keeps values exactly as printed, flags likely OCR errors and validates totals against the source. Use before analysis.
license: CC0-1.0
arguments:
  - source
  - output_format
argument-hint: <source> [output_format]
disable-model-invocation: true
metadata:
  version: 1.0.0
  kind: prompt
  category: spreadsheets
  source: https://hermes-ide.com/prompts/extract-tables-from-pdf
  catalog: 2026.1014.1
---

# Extract tables from a PDF

## Inputs

- `source` (required): The text copied or OCR'd from the PDF pages containing the tables, including headers, footnotes and page numbers.
- `output_format` (optional; one of: csv, markdown-table, json; default: csv): Format for the extracted tables.

Arguments fill these in order. If a required value is empty, take it from the user’s message or ask for it once.

<context>
Text copied from PDFs loses table structure: columns run together, multi-line cells split into separate rows, headers span several lines, tables continue across pages with repeated headers, and scanned pages add OCR errors such as O for 0, l for 1 or a dropped decimal point. Financial and statistical tables also carry meaning outside the cells: units in the title ("in thousands of EUR"), negatives in parentheses, footnote markers and subtotal rows. A clean extraction preserves every printed value and proves itself by re-adding the totals.
</context>

<task>
Extract every table from this source as $output_format:
<source>
$source
</source>

1. Find each table and give it a name from its title or caption, with the page if shown.
2. Rebuild the structure: one header row (flatten multi-level headers as "Parent - Child"), one row per record, multi-line cells joined, and tables that continue across pages merged with repeated headers removed.
3. Normalise numbers for machine use: remove thousands separators, turn parentheses into a leading minus sign, keep the decimal places printed, and move units and scale into the column name (for example "revenue_eur_thousands"). Keep "-", "n/a" and blank cells as empty values and list them.
4. Keep footnote markers out of numeric cells and put them in a separate notes column or list.
5. Keep subtotal and total rows, labelled as such in a row-type column, so they can be validated and then filtered out.
6. Validate: recompute every printed total and subtotal (rows and columns) from the extracted values and compare. Report each match and each mismatch with the difference.
7. Flag suspected OCR errors: characters inside numbers, implausible magnitudes, misaligned columns, and totals that fail by an amount that suggests a single misread digit.
</task>

<constraints>
- Never change a printed value to make a total work. Report the mismatch and the likely culprit instead.
- Never fill an empty or unreadable cell with a guess; leave it empty and list it.
- Output each table in a separate fenced block. For csv, use commas, quote fields that contain commas, and put the header in the first line. For json, give an array of objects per table with the column names as keys and numbers as numbers.
- If the source has no recognisable table, or the text is too garbled to rebuild columns reliably, say so and ask for a better copy (for example exported text, a higher-resolution scan or the page image) rather than producing a doubtful table.
</constraints>

<output_format>
## Tables found
For each table: its name, page, row and column count, then the table in a fenced block.
## Validation
A table: table | total checked | printed | recomputed | result (match / mismatch and difference).
## Issues to check
Bullets: empty cells, suspected OCR errors and structural guesses, each with its location.
</output_format>

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.