🔍

首页Home › 开发工具Developer Tools

🔀 CSV 交换两列Swap CSV Columns

交换 CSV/TSV 中的两列(按列号或表头名),其它列不动。可设置「列 A」、「列 B」、「第一行是表头」。Swap two columns in a CSV or TSV (by number or header name); every other column stays put. Settings: Column A, Column B, First row is a header.

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

「CSV 交换两列」是什么?What is the Swap CSV Columns tool?

交换 CSV/TSV 中的两列(按列号或表头名),其它列不动。可设置「列 A」、「列 B」、「第一行是表头」。Swap two columns in a CSV or TSV (by number or header name); every other column stays put. Settings: Column A, Column B, First row is a header.

如何使用「CSV 交换两列」?How do I use the Swap CSV Columns tool?

在「CSV 交换两列」中,把内容粘贴或输入到上方输入框,按需设置「列 A」、「列 B」,结果会实时显示在下方,点击「复制结果」即可复制。Paste your CSV and enter the two columns to swap in "Column A" and "Column B", by number or header name. The swapped CSV appears below; click "Copy result" to copy it.

可以一次交换多列吗?Can I swap several columns at once?

本工具一次只交换两列;要整体重排请用“CSV 列排序”。This tool swaps one pair; for a full reorder use Sort CSV Columns.

行长度不一致(有的行字段多、有的行字段少)时会怎样?What happens when rows have different numbers of fields?

不会凭空补字段,也不会删掉字段:操作只作用于每行实际存在的字段,每行保持自己原来的长度。比如某行没有要处理的那一列,这一行就原样保留。检测到这种行时,结果下方会有一行提示说明有几行。需要统一列数时,请用“CSV 补齐不完整行”。No fields are invented or dropped: the operation only touches the fields each row actually has, and every row keeps its own length. If a row does not have the column being changed, that row is left as it is. When such rows are found, a one-line note below the result says how many. To give every row the same number of fields, use Fill Incomplete CSV Records.

表头里有重名的列,或者同一列写了两次会怎样?What if two columns share a header name, or I list a column twice?

按名字选择时只会用到第一个同名列,结果下方会给出提示,列出所有同名列的位置;要选其他同名列请直接写列号。同一列写了两次(例如 1,1)只算一次,也会提示是哪一列。A header name picks the first column with that name, and a note below the result lists every column that shares it; use a column number to pick another one. A column listed twice (for example 1,1) is used once, and the note names it.

表头会一起交换吗?Is the header swapped too?

会。整列(含表头行)一起对调。Yes. The whole column, header row included, is swapped.

输入和输出是什么样的?What does the input and output look like?

例如在「CSV 交换两列」中输入 a,b,c ⏎ 1,2,3,输出为:b,a,c ⏎ 2,1,3(⏎ 表示换行)。The input a,b,c ⏎ 1,2,3 becomes b,a,c ⏎ 2,1,3 (⏎ marks a line break).

有哪些选项可以调整?What options can I adjust?

「CSV 交换两列」的设置:「列 A」默认 1;「列 B」默认 2;可勾选:「第一行是表头」(默认勾选)。改动任一选项后结果会按新设置重新生成。You can adjust "Column A" (default: 1); "Column B" (default: 2); and the "First row is a header" (on by default) checkbox. The result updates as soon as you change a setting.

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

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

「CSV 交换两列」免费吗?需要注册吗?Is the Swap CSV Columns tool free? Do I need an account?

「CSV 交换两列」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Swap CSV Columns tool 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

🔃 CSV 列排序(按表头名或指定顺序重排)Sort CSV Columns🗑️ CSV 删除列Delete CSV Columns✂️ CSV 去除单元格首尾空格Trim CSV Columns📏 CSV 截断单元格(限制最大长度)Truncate CSV Columns🔗 CSV URL 编码(编码单元格)URL-Encode CSV🔓 CSV URL 解码(解码单元格)URL-Decode CSV🔀 十六进制 OR 运算(按位或)OR Hex Numbers⊼ 十六进制 NAND 运算(与非)NAND Hex Numbers⊕ 十六进制 XOR 运算(按位异或)XOR Hex Numbers🔁 反转十六进制数字Reverse Hex Digits🔄 循环移动十六进制数字Rotate Hex Digits🔀 打乱十六进制数字(可复现种子)Shuffle Hex Digits

← 全部工具All tools