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

将 CSV 行转换为列

此工具可将 CSV(逗号分隔值)文件的行转换为列。它会从输入的 CSV 文件中逐行提取水平线,将其旋转 90 度,然后将其输出为垂直列,并以逗号分隔。', longDescription: '此工具可将 CSV(逗号分隔值)文件的行转换为列。例如,如果输入的 CSV 数据有 6 行,则输出将有 6 列,并且行中的元素将按从上到下的顺序排列。在格式正确的 CSV 文件中,每行的值数量相同。但是,如果行中缺少字段,程序可以修复它们,您可以从可用选项中进行选择:用空元素填充缺失数据,或用自定义元素(例如“missing”、“?”或“x”)替换缺失数据。在转换过程中,该工具还会清除 CSV 文件中的不必要信息,例如空行(这些行没有可见的信息)和注释。为了帮助工具正确识别注释,您可以在选项中指定行首的注释符号。此符号通常是井号“#”或双斜杠“//”。CSV 真棒!

Input text

​

Result

​

工具选项

Fix incomplete data

Fill With Customs Values
​

If the input CSV file is incomplete (missing values), then add empty fields or custom symbols to records to make a well-formed CSV?

​

Use this custom value to fill in missing fields. (Works only with "Custom Values" mode above.)

Lines with comments

​

Enter the symbol indicating the start of a comment line. (These lines are removed during conversion.)

What is a 将 CSV 行转换为列?

此工具可将 CSV(逗号分隔值)文件的行转换为列。例如,如果输入的 CSV 数据有 6 行,则输出将有 6 列,并且行中的元素将按从上到下的顺序排列。在格式正确的 CSV 文件中,每行的值数量相同。但是,如果行中缺少字段,程序可以修复它们,您可以从以下选项中进行选择:用空元素填充缺失数据,或用自定义元素替换缺失数据,例如


将 CSV 行转换为列 示例

点击尝试!

Convert CSV Rows to Columns

In this example, we transform the input CSV file with a single horizontal row of six values "a,b,c,d,e,f" into a vertical column. The program takes this row, rotates it 90 degrees, and outputs it as a column with each CSV value on a new line. This operation can also be viewed as converting a 6-dimensional row vector into a 6-dimensional column vector.

​
​

Fix incomplete data

Fill With Empty Values
​

If the input CSV file is incomplete (missing values), then add empty fields or custom symbols to records to make a well-formed CSV?

Lines with comments

​

Enter the symbol indicating the start of a comment line. (These lines are removed during conversion.)

Rows to Columns Transformation

In this example, we load a CSV file containing coffee varieties and their origins. The file is quite messy, with numerous empty lines and comments, and it is hard to work with. To clean up the file, we specify the comment pattern // in the options, and the program automatically removes the comment lines from the input. Also, the empty lines are automatically removed. Once the file is cleaned up, we transform the five clean rows into five columns, each having a height of two fields.

​
​

Fix incomplete data

Fill With Empty Values
​

If the input CSV file is incomplete (missing values), then add empty fields or custom symbols to records to make a well-formed CSV?

Lines with comments

​

Enter the symbol indicating the start of a comment line. (These lines are removed during conversion.)

Fill Missing Data

In this example, we swap rows and columns in CSV data about team sports, the equipment used, and the number of players. The input has 5 rows and 3 columns and once rows and columns have been swapped, the output has 3 rows and 5 columns. Also notice that in the last data record, for the "Baseball" game, the number of players is missing. To create a fully-filled CSV, we use a custom message "NA", specified in the options, and fill the missing CSV field with this value.

​
​

Fix incomplete data

Fill With Customs Values
​

If the input CSV file is incomplete (missing values), then add empty fields or custom symbols to records to make a well-formed CSV?

​

Use this custom value to fill in missing fields. (Works only with "Custom Values" mode above.)

Lines with comments

​

Enter the symbol indicating the start of a comment line. (These lines are removed during conversion.)


全部 CSV 工具


  • 将 CSV 转换为 JSON — 将 CSV 数据转换为 JSON 格式。
  • 将 CSV 转换为 XML — 将 CSV 数据转换为 XML 格式。
  • 将 CSV 转换为 TSV — 将 CSV 数据转换为 TSV 格式。
  • 交换 CSV 列 — 重新排序 CSV 列。
  • 将 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