★LocalHost Run Under Construction
  • 首页
  • 文章
  • 工具
http://localhost
首页文章工具
全部工具›CSV 工具›交换 CSV 列

交换 CSV 列

只需在下方表单中上传您的 CSV 文件,指定要交换的列,该工具就会自动更改输出文件中指定列的位置。在工具选项中,您可以指定要交换的列位置或名称,还可以修复不完整的数据,并选择性地删除空记录和已注释掉的记录。

Input text

​

Result

​

工具选项

Swap-From Column

Set Column-From position

​

Position of the first column you want to swap

Set Column-From Header

Swap-to Column

Set Column-To position

​

Position of the second column you want to swap

Set Column-To Header

Incomplete Data

Fill With Empty Values
​

Fill incomplete CSV data with empty symbols or a custom symbol.

Comments and Empty Lines

if checked, comments given by the following character will be deleted

​

Specify the character used to start comments in the input CSV (and if needed remove them via checkbox above)

Do not include empty lines in the output data.

What is a 交换 CSV 列?

此工具通过交换列的位置来重新组织 CSV 数据。交换列可以将常用数据放在一起或放在最前面,以便于数据比较和编辑,从而提高 CSV 文件的可读性。例如,您可以将第一列与最后一列交换,或者将第二列与第三列交换。要根据列的位置交换列,请选择


交换 CSV 列 示例

点击尝试!

Move the Key Column to the First Position

In this example, we use our CSV column swapping tool to bring the most important information to the first column. As we are planning to go on vacation soon, in the input of the tool, we load data about national parks that include their names and locations. To decide, which is the closest park to us, we need to see the parks location first, therefore, we swap the first and second data columns so that the "location" column is at the beginning of the CSV data.

​
​

Swap-From Column

Set Column-From position

​

Position of the first column you want to swap

Set Column-From Header

Swap-to Column

Set Column-To position

​

Position of the second column you want to swap

Set Column-To Header

Incomplete Data

Fill with Custom Values
​

Fill incomplete CSV data with empty symbols or a custom symbol.

​

Specify a custom symbol to fill incomplete CSV data with

Comments and Empty Lines

if checked, comments given by the following character will be deleted

Do not include empty lines in the output data.

Reorganize Columns in Vitamins CSV

In this example, a lab intern made a mistake and created a corrupted CSV file with mixed-up columns and missing data. To fix the file, we swap the columns based on the headers "Vitamin" and "Function" so that the "Vitamin" column becomes the first in the output data. We also fill the incomplete CSV data by adding a custom asterisk "*" symbol in place of missing values.

​
​

Swap-From Column

Set Column-From position

Set Column-From Header

​
​

Header of the first column you want to swap.

Swap-to Column

Set Column-To position

Set Column-To Header

​
​

Header of the second column you want to swap..

Incomplete Data

Fill with Custom Values
​

Fill incomplete CSV data with empty symbols or a custom symbol.

​

Specify a custom symbol to fill incomplete CSV data with

Comments and Empty Lines

if checked, comments given by the following character will be deleted

Do not include empty lines in the output data.

Place Columns Side by Side for Analysis

In this example, we change the order of columns in a CSV dataset to have the columns essential for analysis adjacent to each other. We match the "ScreenSize" column by its name and place it in the second-to-last position "-2". This groups the "ScreenSize" and "Price" columns together, allowing us to easily compare and choose the phone we want to buy. We also remove empty lines and specify that lines starting with the "#" symbol are comments and should be left as is.

​
​

Swap-From Column

Set Column-From position

Set Column-From Header

​
​

Header of the first column you want to swap.

Swap-to Column

Set Column-To position

​

Position of the second column you want to swap

Set Column-To Header

Incomplete Data

Fill With Empty Values
​

Fill incomplete CSV data with empty symbols or a custom symbol.

Comments and Empty Lines

if checked, comments given by the following character will be deleted

​

Specify the character used to start comments in the input CSV (and if needed remove them via checkbox above)

Do not include empty lines in the output data.


全部 CSV 工具


  • 将 CSV 转换为 JSON — 将 CSV 数据转换为 JSON 格式。
  • 将 CSV 转换为 XML — 将 CSV 数据转换为 XML 格式。
  • 将 CSV 行转换为列 — 将 CSV 行转换为列。
  • 将 CSV 转换为 TSV — 将 CSV 数据转换为 TSV 格式。
  • 将 CSV 转换为 YAML — 快速将 CSV 文件转换为 YAML 文件。
  • 更改 CSV 分隔符 — 更改 CSV 文件分隔符
  • 查找不完整的 CSV 记录 — 快速查找 CSV 中缺少值的行和列。
  • 转置 CSV — 快速转置 CSV 文件。
  • 插入 CSV 列 — 在 CSV 文件中的任何位置快速插入一个或多个新列。
  • TSV 到 JSON — 将 TSV 转换为 JSON 格式

LocalHost Run · 联系我们 · 隐私政策 · 使用条款

© 2026 LocalHost Run · localhost 指南、文章与开发者工具 · localhostrun.com
访客计数: 1025Best viewed in Netscape Navigator · 800×600© LocalHost Run