CSVLane

Runs in this tab. Nothing is uploaded. Check it yourself

Text to CSV · Tested

How to convert text to CSV

By CSVLane · Published 30 October 2026

A .txt file converts to CSV in one step if its columns are separated by one consistent character: a tab, pipe or semicolon. Open it in CSVLane, set Output to Comma and download. If the columns only line up with spaces, or there is one value per line, it needs one small fix first.

A converter can only split what it can see. We ran five small text files through CSVLane on 30 October 2026 and recorded what came out. Every file is below, so you can repeat the test here or in any other converter.

Test results: five kinds of text file

FileLayoutDetectedColumnsResult
text-tab.txtTab between columns; commas inside valuestab3Correct. Canvas tote, natural stays one value and gets quoted
text-pipe.txtPipe between columnspipe4Correct. Portland, OR stays one value and gets quoted
text-semicolon.txtSemicolon; decimal commas; a quoted semicolonsemicolon3Correct. 24,00 stays one value and gets quoted
text-spaces.txtColumns aligned with spacesnone1Not split. Each line stays one cell
text-list.txtOne value per line, no headingnone1One column, but the first value becomes the column name

Three of five converted in one step. The two that did not are the two with no separator character for a tool to find.

Convert a delimited text file in four steps

  1. Open the Clean workspace and choose your file, drop it on the panel, or use Paste text. Files ending in .txt, .tsv and .csv are accepted, up to 15 MB.
  2. Check that the table shows the columns you expect. The file line names the separator it found.
  3. For a pure conversion, untick Trim extra spaces, Remove empty rows and Remove duplicate rows, so that no data changes along the way. The example links below already have them unticked.
  4. Set Output to Comma and download the file.
CSVLane with text-pipe.txt loaded: a pipe separator detected and four columns of data in the preview table
text-pipe.txt after loading: four separate columns, with “Portland, OR” in one cell. That comma would break a find-and-replace of | with a comma. Open this example in CSVLane ↗

Why not find-and-replace the separator? In the pipe file, the value Portland, OR holds a comma. Replacing | with , gives that row five columns instead of four. A CSV writer quotes the value instead, as RFC 4180 says a field containing a comma should be:

Input (pipe)

1003|Ana Silva|Portland, OR|Team

Output (comma)

1003,Ana Silva,"Portland, OR",Team

Space-aligned text: split it yourself first

Some reports and command-line output line columns up with spaces. In text-spaces.txt, the single space in Rae Okafor sits next to the double spaces between columns, so no single character separates the columns. CSVLane does not guess here: it keeps each line as one cell, and the column count of 1 tells you.

CSVLane showing text-spaces.txt as one column, with each whole line in a single cell
A single column named “id name city”. This is the sign that the file has no separator the tool can use. Open this example in CSVLane ↗

If at least two spaces always separate your columns and values never contain two spaces in a row, this Python one-liner gives a correct split. It produced the right three columns on our test file:

import csv, re, sys
csv.writer(sys.stdout).writerows(re.split(r" {2,}", line.strip()) for line in open("text-spaces.txt"))

Check the result. A value padded by only one space from the next column, or a blank cell, will shift everything after it. If a column can be empty, you need the character positions of each column, which only you or the file's documentation can supply.

One value per line: add a heading

text-list.txt is three email addresses. There is nothing to split, and it is already valid one-column CSV, but a CSV reader treats the first line as the heading:

CSVLane with text-list.txt: the first email address appears as the column name and two rows remain
rae@example.com has become the column name, leaving two data rows. Add a heading line such as “email” before importing the file elsewhere. Open this example in CSVLane ↗

Fix it by pasting the text into Paste text with email as a new first line.

Before you import the result

Where to go next

Sources

  1. RFC 4180: Common Format and MIME Type for CSV Files, read 30 October 2026.