Pull tables from PDFs into a spreadsheet

Each matching table from your PDFs and scans in one sheet, with numbers as numbers and the page noted.

  • You start it: When you start it

What it does

The task

Open the PDF files in the Google Drive folder folder url, scanned pages too. Find each table that matches this description: table description. Copy each table into a new Google Sheet, one tab for each file, with the same columns in each tab. Store numbers as numbers and dates as YYYY-MM-DD, and add a Source column with the file name and the page. Check each total row against the sum of its rows. List each table that you could not read with confidence.

  • It works in Google Drive and Google Sheets, in the workspace you pick, and signs in with passwords from your Cuiar vault.
  • It runs once, when you start it.

What you give it

BlankWhat to giveExample
folder urlThe Google Drive folder with the PDF fileshttps://drive.google.com/drive/folders/1Pd3kXq8Wm
table descriptionWhich tables to copyQuarterly sales by region

What you get back

An example run with the example values above. Your run uses your own data.

PDFs read: 12 (3 scanned). Tables found: 19

Sheet: PDF tables, 12 tabs, 486 rows

Columns: Region, Quarter, Units, Revenue EUR, Source

Totals checked: 18 of 19 match

  • Mismatch: Q2-report.pdf, page 7. The total says 1,284,000; the rows add up to 1,248,000.

Low confidence: scan-2024-q1.pdf, page 3 (blurred), 4 cells marked in yellow

Run it in Cuiar

  1. 01

    Open it

    Click Use in Cuiar on this page. The side panel opens with the task in the composer.

  2. 02

    Fill in 2 blanks

    Type folder url and table description. Tab moves to the next blank.

  3. 03

    Run it

    Run sends it to the agent. Follow each step in the panel, and stop it at any time.

From the terminal

cuiar exec "Open the PDF files in the Google Drive folder https://drive.google.com/drive/folders/1Pd3kXq8Wm, scanned pages too. Find each table that matches this description: Quarterly sales by region. Copy each table into a new Google Sheet, one tab for each file, with the same columns in each tab. Store numbers as numbers and dates as YYYY-MM-DD, and add a Source column with the file name and the page. Check each total row against the sum of its rows. List each table that you could not read with confidence."

Run it from your AI agent

Claude Code, Codex, Cursor and other MCP clients reach Cuiar at https://mcp.cuiar.com/mcp. Add the server one time, then ask for the task in plain words, or call run_task yourself.

1. Add Cuiar to Claude Code

claude mcp add --transport http cuiar https://mcp.cuiar.com/mcp

2. Ask your agent

Use the Cuiar tool run_task to run my "Pull tables from PDFs into a spreadsheet" template with folder url = https://drive.google.com/drive/folders/1Pd3kXq8Wm; table description = Quarterly sales by region.

Setup for other agents: AI agents.

The tool call

{
  "name": "run_task",
  "arguments": {
    "task": "Open the PDF files in the Google Drive folder https://drive.google.com/drive/folders/1Pd3kXq8Wm, scanned pages too. Find each table that matches this description: Quarterly sales by region. Copy each table into a new Google Sheet, one tab for each file, with the same columns in each tab. Store numbers as numbers and dates as YYYY-MM-DD, and add a Source column with the file name and the page. Check each total row against the sum of its rows. List each table that you could not read with confidence."
  }
}
All data templates