Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Excel workbooks as input

A .xlsx file is an input like a PDF or a Word document (kakemono convert sales.xlsx -o sales.md); the format is recognised from the file’s bytes. The cells say what the content is, so the workbook is read directly into the same structure, to read it comfortably outside Excel’s grid or to feed it to an AI:

  • each visible sheet is a section headed by its name; hidden sheets, rows and columns are left out;
  • the cells of a sheet are cut into tables where empty rows or columns separate them; a title or unit line above a table is its caption, single-cell rows below it are notes;
  • the header rows of a table come from --header-rows N if given, else from what the file declares (Excel Table, auto-filter, frozen rows, print titles), else from the types of the columns (the header is the rows above the first one whose cells have the type of their column), else the first row;
  • values are shown as Excel shows them: percentages, thousands separators, decimals; dates and times always in ISO form (2024-01-31, 14:05); furigana never reaches the text;
  • the text of shapes and text boxes is read; forms drawn on a grid keep their text, not their look;
  • pictures become figures (also those of groups, and those placed in cells, after their table); charts are drawn by kakemono as SVG, sharp at any zoom (bar, column, line, area, pie, doughnut, scatter, radar, and bar and line combined; the colours and data labels of the file), each followed by a table of its data, which is what the chunks and the JSON give;
  • in the chunks (.jsonl), a table is cut between rows and every chunk repeats its header rows.
kakemono convert sales.xlsx -o sales.md                  # Markdown, a pipe table per region
kakemono convert sales.xlsx -o sales.jsonl               # chunks for retrieval (RAG)
kakemono convert sales.xlsx --header-rows 2 -o sales.md  # two header rows in every table (0: none)

-m medium (and hard, hard-95) shows the workbook as Excel does: a tab per sheet, and on each the grid of its cells with their widths, heights, merges, fonts, fills, borders and alignment, the column letters and row numbers, and its charts, pictures, shapes and connectors drawn where they are anchored. friendly is the workbook as a document, the form every other output takes. -o sales.pdf prints it as Excel prints it, without TeX: each sheet’s print area (or the cells it uses) cut into pages by its print settings (paper, orientation, margins, scale or fit to pages, manual breaks, rows repeated at the top), with the look of every cell and its charts, pictures and shapes where they are anchored, the text kept as text. --pdf-style document lays it out as a document instead: each sheet after its heading, tables with rules and their cells wrapped in their columns, a long table broken between rows with its header rows repeated on each page, a wide one set smaller, then on landscape pages, then in groups of columns (no column is ever cut off), charts drawn as vector, CJK text in CJK fonts; on A4 unless the workbook’s print settings name another paper. Details: docs/EXCEL-INPUT.md.