文件格式任意转换助手Transfer Any File

离线 · 无上传 · 浏览器本地完成Offline · no uploads · runs in the browser

Markdown 表格转 CSV——离线、可批量、不上传Markdown table to CSV offline, in batches, no upload

表格写进 Markdown 容易,想再拿回电子表格里算就麻烦了。这条链路把 Markdown 先渲染成 HTML,再从 `<table>` 提取记录:首行给列名,其余每行一个对象,最后按**值**写成 CSV、不走显示格式——这条链上每个格子本来就是表格里的文本,所以 `2024-01-05` 不会被改写成日期序列号。正文(标题、段落、列表)没有单元格可落,不参与结果;但如果整篇没有表格,代码块里的一段 JSON 数组也会被读进来。Getting a table into Markdown is easy; getting it back into a spreadsheet to compute on is not. This route renders the Markdown to HTML, then reads records out of the `<table>`: the first row supplies column names, every other row becomes an object, and the CSV is written from **values** rather than display text — and on this route every cell is already the table’s own text, so `2024-01-05` is not rewritten into a date serial. Headings, paragraphs and lists have no cell to land in and are not part of the result, but with no table at all, a JSON array inside a code block is read instead.

一批转换结果卡片,含文件名、体积与下载入口
一次混合批量,一个 ZIP 下载One mixed batch, one ZIP download

这条链路怎么走How the route runs

MarkdownMarkdown HTMLHTML JSONJSON CSVCSV

共 3 步,由扩展的路径搜索自动选出,中间产物不落盘。3 steps, chosen by the extension's own path search; intermediate results never touch the disk.

会保留什么What carries over

  • 首行当列名、其余行当记录,键的顺序就按表头那一行;不同行列数不一致时取所有行键名的并集,缺的格子写空值The first row supplies column names and the rest are records, keys in header order; when rows disagree the keys are unioned and a missing cell is written empty
  • 按值写出、不走显示格式:这条链上每个格子本来就是表格里的文本,所以不存在「日期被改成序列号」那一类二次加工Written from values rather than display text: every cell on this route is already the table’s own text, so nothing is reformatted on the way out
  • 文件开头带 UTF-8 BOM,Excel 双击就是正常中文,不需要「导入向导」The file starts with a UTF-8 BOM, so a double-click in Excel shows Chinese correctly without an import wizard
  • 以 `=`、`+`、`-`、`@` 或制表符 / 回车开头的文本会被加一个前导单引号,防止这份 CSV 再被 Excel 当公式执行——代价是那一格不是逐字节原样Text beginning with `=`, `+`, `-`, `@`, a tab or a carriage return is prefixed with an apostrophe so the CSV cannot be re-evaluated as a formula by Excel — the cost is that such a cell is not a byte-for-byte copy

如实说明的限制What it does not do

  • 只有表格(或一段能当 JSON 数组读的代码块)能变成 CSV:整篇没有可解析的结构时直接报错,不会产出一份空文件Only a table — or a code block that parses as a JSON array — becomes CSV: with nothing parseable in the document it fails rather than writing an empty file
  • 多张表不行:HTML 转 JSON 那一步会把多张表并成「按小标题分组」的一个对象,而 JSON 转 CSV 只吃数组,于是报「JSON 不是数组」。要一张一张拿,先把它们分开转Several tables do not work: the HTML-to-JSON step merges them into one object keyed by their headings, and JSON-to-CSV accepts only arrays, so it reports “not an array”. Convert them one at a time
  • 列名只由首行给:某行多出的单元格会被丢掉,缺的列写空;首行里有重复或为空的表头会互相覆盖(同名的后一格赢),跨 `colspan` 的表头也只算一格,所以表头要写干净The first row alone names the columns: extra cells in a later row are dropped and missing ones come out empty, a repeated or empty header overwrites its twin (the later cell wins), and a header spanning `colspan` counts as one cell — so write the header row cleanly
  • 格子里的链接只剩文字,地址不进 CSV;加粗、行内代码也只剩内容本身A link inside a cell contributes its words only, so the address is not in the CSV, and bold or inline code arrive flattened
  • 表格套在单元格里,等于文档里就有两张表:与「多张表」同一格——中转步把它们并成一个分组对象,CSV 那一步拒绝,整次转换报错A table nested inside a cell is a second table as far as this route is concerned: the middle step merges the two into one grouped object and the CSV stage refuses it, so the conversion fails the same way several tables do

实操提示Working with it

  • 一批最多 200 个文件,单个文件上限 100 MB;多个 .md 一起转逐个产出各自的 .csv,想一次拿走就打成一个 ZIPUp to 200 files per batch and 100 MB per file; several .md files yield one .csv each, and the set can be taken as a single ZIP
  • 想要的是对象数组而不是 CSV 行,走 Markdown 转 JSON——同一条提取逻辑,只是终点不同For objects rather than CSV rows, take Markdown to JSON — the same extraction, a different endpoint
  • 想整篇文档(含标题与段落)都进表格,是不可能的:CSV 只有行列,正文没有可落的地方。要留正文就走 Markdown 转 Word 或转 HTMLNo route can put headings and paragraphs into a CSV: the format has only rows and columns, and prose has nowhere to land. Keep the prose by going Markdown to Word or to HTML

常见问题Questions people actually ask

我的文档里有两张表,为什么转 CSV 失败?My document has two tables — why does the CSV conversion fail?

因为多张表在中间那一步被并成了一个「按小标题分组」的对象,而 CSV 这一步只接受数组。把两张表分别放到两个文件里各转一次,或者先合成一张表再转。Because several tables are folded by the middle step into one object keyed by their headings, and the CSV step accepts only arrays. Split them into two files and convert each, or merge them into one table first.

格子里的数字会被改成科学计数法吗?Will a number in a cell come out in scientific notation?

不会。这条链上的格子本来就是表格里的文本,写 CSV 时按值原样落地,不走显示格式;表格单元格里也不存在「被 Excel 认出是数字再改写」这一步,因为值从 HTML 取出来就已经是字符串了。No. Every cell on this route is the table’s own text, and the CSV writes those values as they are, without a display format — there is no step where Excel recognises a number and rewrites it, because the value read out of the HTML is already a string.

整篇没有表格,只有一段 JSON 代码块,能转吗?No table, only a JSON code block — does that work?

能。没有表格时会把 `<pre>` / `<code>` 里的内容当 JSON 解析,是一个数组就照上面写;不是合法 JSON 或不是数组就报错,不返回空文件。Yes. With no table the text of the `<pre>` / `<code>` block is parsed as JSON, and an array follows the same writer. Anything that is not valid JSON, or not an array, is reported instead of returning an empty file.

文档内容会被上传吗?Is the document uploaded anywhere?

不会。渲染 Markdown、读表格、写 CSV 都在扩展自己的标签页里完成,只申请 storage 权限、没有 host 权限,全程零网络请求。No. Rendering the Markdown, reading the table and writing the CSV all happen inside the extension’s own tab: the storage permission only, no host permissions, and no requests at any point.

不需要账号,也不需要联网:装好扩展后点图标,在新标签页里打开工作台,文件从磁盘直接选。No account and no network: install the extension, click its icon, and the workbench opens in a new tab reading straight off your disk.