Pull data from many files into one table with Claude

The struggle: The numbers you need sit in a dozen PDFs and you retype them into a sheet.

What you end up with: One table with a row per file, each value tied to its file and page, plus a short list of values Claude could not find.

Define the columns first, then have Claude fill one row per file and cite where each value came from. A sum check and a spot check catch the rest. It also works for a table inside a single PDF.

Tools: Claude. Level: Free to start. Time: 30 min.

Use it if

  • You collect the same fields from many PDFs, such as supplier statements or invoices
  • You get a table inside a PDF and need it in a spreadsheet
  • The files are text PDFs or exports, not photos

Skip it if

  • The documents are scanned images and you cannot spot check them
  • You need an audit-grade extraction

What you need first

  • Copies of the files, with card and bank numbers removed
  • Code execution and file creation on (on by default)

The method

  1. Test the columns on one file (Claude: Chat)

    Start a chat, upload one typical file and paste the prompt. Fix the column list until the row is right. When you ask about pages, use the page numbers your PDF viewer shows, not those printed on the page.

    Prompt to copy:

    Read the attached file. Extract one row with these columns: [list your columns, for example supplier, document date, document number, net, tax, total, currency]. For every value add the page it came from. If a value is missing or unclear, write NOT FOUND and say why. Do not calculate or guess.

    You get: A column list that works on a real file.

    Tip: Test your hardest file first, such as the odd layout or the scan, so you know the limit early.

  2. Run it across the whole batch (Claude: Chat)

    Open a new chat and upload up to 20 files at once, copies only. Paste the prompt. For a bigger batch, run it in groups and label each group.

    Prompt to copy:

    Using the same columns and rules, extract one row per attached file into a table. Add the file name and page for every value. After the table list every NOT FOUND and any file you could not read. Never fill a gap with an estimate.

    You get: A table with one row per file and a NOT FOUND list.

    Tip: Keep batches small. Long chats get shorter memory of early files, so ask for the table in chunks if it is long.

  3. Make it prove the totals (Claude: Chat)

    Compare totals that you can read directly from the source, such as the total printed on each document, with Claude's column. Then ask the prompt below to find mismatches.

    Prompt to copy:

    For each file compare the total column with the sum of the lines you extracted, if the document gives lines. List every row where the two disagree, with both figures. Also list duplicate document numbers.

    You get: A list of rows that disagree with the source totals.

    Tip: Where a document prints its own total, a mismatch is a free error detector.

  4. Export and spot check (Claude: Code execution and file creation)

    Ask Claude to create an .xlsx. Open it, pick three rows at random plus every NOT FOUND, and check them against the original files yourself. Fix errors in the sheet, not by re-prompting.

    Prompt to copy:

    Create an .xlsx file of the final table with one header row, the file name in the first column and no merged cells. Keep dates as real dates and amounts as numbers.

    You get: A spreadsheet you checked against the sources.

    Tip: Pick the rows to check yourself. Claude's choice of rows tends to favour the easy ones.

Where this goes wrong

  • Scanned or photographed pages can be misread. The help centre does not say how well scans are handled, so test one first.
  • A plausible number in the wrong column is the common error. Spot check, do not trust the whole table.
  • Never upload full card or bank numbers.
  • Have a qualified person check this before you sign, file or send it.

Sources

More like this

Updated . Written with AI help and checked by an independent review step, as described in our editorial standards.