首页Home › 开发工具Developer Tools

🔄 CSV 行列转置Transpose CSV

把 CSV/TSV 表格的行和列互换(第一行变第一列),自动识别逗号、制表符、分号或竖线分隔,正确处理带引号和换行的单元格,行长度不齐时自动补空。Swap the rows and columns of a CSV or TSV table (first row becomes first column). Comma, tab, semicolon or pipe delimiters are detected, quoted cells with line breaks are handled, and ragged rows are padded.

使用说明与常见问题How-to & FAQ

「CSV 行列转置」是什么?What is the Transpose CSV tool?

把 CSV/TSV 表格的行和列互换(第一行变第一列),自动识别逗号、制表符、分号或竖线分隔,正确处理带引号和换行的单元格,行长度不齐时自动补空。Swap the rows and columns of a CSV or TSV table (first row becomes first column). Comma, tab, semicolon or pipe delimiters are detected, quoted cells with line breaks are handled, and ragged rows are padded.

如何使用「CSV 行列转置」?How do I use the Transpose CSV tool?

在「CSV 行列转置」中,把内容粘贴或输入到上方输入框,结果会实时显示在下方,点击「复制结果」即可复制。In the Transpose CSV: Paste or type into the input box; the result appears below instantly — click "Copy result" to copy it.

转置是什么意思?What does transposing mean?

转置就是把表格沿对角线翻转:原来第 i 行第 j 列的单元格移到第 j 行第 i 列。比如表头一行变成第一列,适合把“横向”数据改成“纵向”。Transposing flips the table over its diagonal: the cell in row i, column j moves to row j, column i. A header row becomes the first column, turning wide data into long data.

单元格里有逗号或换行会出错吗?Will commas or line breaks inside cells break it?

不会。按 RFC 4180 解析:用双引号包住的单元格可以包含逗号、换行和 "" 转义的引号;输出时需要时会重新加引号。No. Parsing follows RFC 4180: a cell in double quotes may contain commas, line breaks and quotes escaped as ""; quotes are added back on output where needed.

各行列数不一样怎么办?What if rows have different lengths?

以最长的一行为准,短行缺少的单元格按空值处理,并在结果下方提示。The longest row sets the width; missing cells in shorter rows become empty, and a notice appears below the result.

分隔符是怎么自动识别的?How is the delimiter detected?

工具用逗号、制表符、分号、竖线分别解析前 50 行,选择各行列数最一致、且至少有 2 列的那个;同样一致时优先制表符、分号、竖线,最后才是逗号(因为逗号常出现在内容里)。识别结果显示在结果下方,识别错了请手动选择分隔符。空行会按空数据行保留;引号前的空格(如 a, "b,c")会被忽略,引号照常生效。The tool parses the first 50 lines with comma, tab, semicolon and pipe, and picks the one that gives the most consistent column count with at least 2 columns. On a tie it prefers tab, then semicolon, then pipe, then comma (commas often appear inside text). The detected delimiter is shown below the result; if it is wrong, choose the delimiter yourself. Blank lines are kept as empty rows, and spaces before a quote (a, "b,c") are ignored so the quote still works.

代码或数据会被上传吗?Is my code or data uploaded?

不会。「CSV 行列转置」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The Transpose CSV runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.

「CSV 行列转置」免费吗?需要注册吗?Is the Transpose CSV free? Do I need an account?

「CSV 行列转置」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Transpose CSV is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.

相关工具Related tools

📃 JSON 转纯文本JSON to Text Converter🗄️ SQL 转 JSON(INSERT 语句转 JSON)SQL to JSON Converter📗 CSV 转 Excel(XLSX)CSV to Excel Converter📊 XLS 转换器(XLS ⇄ XLSX/CSV/ODS)XLS Converter🧾 JSON 格式化校验JSON Formatter & Validator🧪 正则表达式测试Regex Tester⏰ Cron 表达式解析Cron Expression Explainer🔀 YAML JSON 互转YAML to JSON Converter📊 CSV JSON 互转CSV to JSON ConverterⓂ️ Markdown 在线预览Markdown Live Preview🗄️ SQL 格式化/压缩SQL Formatter & Minifier🧵 字符串转义/反转义String Escape / Unescape

← 全部工具All tools