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