★LocalHost Run Under Construction
  • Home
  • Articles
  • Tools
http://localhost
HomeArticlesTools
All tools›CSV Tools›Convert CSV Rows to Columns

Convert CSV Rows to Columns

This tool converts rows of a CSV (Comma Separated Values) file into columns. It extracts the horizontal lines from the input CSV one by one, rotates them 90 degrees, and outputs them as vertical columns one after another, separated by commas.', longDescription: 'This tool converts rows of a CSV (Comma Separated Values) file into columns. For example, if the input CSV data has 6 rows, then the output will have 6 columns and the elements of the rows will be arranged from the top to bottom. In a well-formed CSV, the number of values in each row is the same. However, in cases when rows are missing fields, the program can fix them and you can choose from the available options: fill missing data with empty elements or replace missing data with custom elements, such as "missing", "?", or "x". During the conversion process, the tool also cleans the CSV file from unnecessary information, such as empty lines (these are lines without visible information) and comments. To help the tool correctly identify comments, in the options, you can specify the symbol at the beginning of a line that starts a comment. This symbol is typically a hash "#" or double slash "//". Csv-abulous!.

Input text

​

Result

​

Tool options

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 Convert CSV Rows to Columns?

This tool converts rows of a CSV (Comma Separated Values) file into columns. For example, if the input CSV data has 6 rows, then the output will have 6 columns and the elements of the rows will be arranged from the top to bottom. In a well-formed CSV, the number of values in each row is the same. However, in cases when rows are missing fields, the program can fix them and you can choose from the available options: fill missing data with empty elements or replace missing data with custom elements, such as


Convert CSV Rows to Columns Examples

Click to try!

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.)


All CSV Tools


  • Convert CSV to JSON — Convert CSV data to JSON format.
  • Convert CSV to XML — Convert CSV data to XML format.
  • Convert CSV to TSV — Convert CSV data to TSV format.
  • Swap CSV Columns — Reorder CSV columns.
  • Convert CSV to YAML — Quickly convert a CSV file to a YAML file.
  • Change CSV Separator — Change CSV file delimiter
  • Find incomplete CSV records — Quickly find rows and columns in CSV that are missing values.
  • Transpose CSV — Quickly transpose a CSV file.
  • Insert CSV columns — Quickly insert one or more new columns anywhere in a CSV file.
  • TSV to JSON — Convert TSV to JSON format

LocalHost Run · Contact · Privacy Policy · Terms of Use

© 2026 LocalHost Run · localhost guides, articles, and developer tools · localhostrun.com
Visitors: 1025Best viewed in Netscape Navigator · 800×600© LocalHost Run