How to Save Excel as a Pipe-Delimited Text File

To save an Excel worksheet as a pipe-delimited file, temporarily change Windows’ list separator to a vertical bar (|), then save the active worksheet as a CSV file. Excel’s save dialog may still call the format “CSV (Comma delimited),” but it uses the Windows list separator when it writes the fields.

This is the simplest method for a one-time export from desktop Excel on Windows. If you cannot change a Windows-wide setting, export a regular CSV and convert it with a CSV-aware script instead.

How Pipe-Delimited Excel Exports Work

A pipe-delimited file is plain text: each row becomes one line, and each cell is separated by |.

For example, these Excel values:

Employee ID Name Team
00421 Ana Lopez Platform

become:

00421|Ana Lopez|Platform

Excel does not normally offer a “pipe-delimited” entry in its Save As file-type list. On Windows, its CSV export uses the system’s regional list separator, which is normally a comma in US settings. Changing that separator to | causes Excel to write pipes between fields instead, according to the North Dakota Tax Department.

The file extension and the delimiter are separate choices: a .csv, .txt, or .dat file can all contain pipe-separated text.

Save Excel as a Pipe-Delimited File in Windows

Choose the method that fits your situation before changing anything.

Situation Best Method Result
You can temporarily change Windows regional settings Change the list separator and save from Excel Direct pipe-delimited export
You cannot change a shared or managed PC setting Export a comma CSV, then convert it with a script Pipe file without changing Windows
You need a .dat or .txt filename Export first, then rename the finished file if the receiving system requires it Same pipe-delimited content

Step 1: Prepare the Worksheet for Export

  1. Save a copy of the workbook in its normal Excel format, such as .xlsx, before exporting. A delimited text file does not preserve worksheets, formulas, formatting, charts, validation rules, or most workbook features.
  2. Open the worksheet you want to export. Excel exports only the active worksheet to a CSV-style text file.
  3. Check important identifier columns before saving. Format values such as account numbers, ZIP Codes, employee IDs, and long reference numbers as Text if leading zeros or exact digits must remain unchanged.
  4. Make sure the worksheet contains no more than 1,048,576 rows and 16,384 columns, which is Excel’s import and export capacity.

If Excel has already converted an identifier such as 000421 to the number 421, formatting the cell as text will not restore the missing zeros. Correct the source value before exporting.

Step 2: Change the Windows List Separator to a Pipe

  1. Close every open Excel window before changing the list separator. Excel reads this regional setting when it starts.
  2. On Windows 11, select the Search bar and type:
    Region Settings
  3. Open the regional settings page. Look for the path that opens the classic Region dialog, often through related regional or administrative settings.
  4. In the Region dialog, open the Formats tab and select Additional settings.
  5. Open the Numbers tab.
  6. Find List separator and record its current value so you can restore it later.
  7. Replace the current separator with:
    |
  8. Select Apply, then OK to close the dialogs.

Windows menus vary between versions and organization-managed devices, so use the Windows version installed on the PC to confirm the exact route to the Region dialog. The important setting is List separator on the Numbers tab.

The list separator is a Windows regional setting rather than an Excel-only option. Treat it as a temporary export setting and restore your original separator when the file is finished.

Step 3: Save the Active Worksheet as CSV

  1. Reopen Excel and open the workbook.
  2. Click the worksheet tab you want to export.
  3. Start the export with File > Save As or File > Save a Copy.
  4. Choose the destination folder and give the file a temporary name such as customers_export.csv.
  5. In Save as type, choose one of these formats: – CSV UTF-8 (Comma delimited) (.csv) when the receiving system expects UTF-8 text. – CSV (Comma delimited) (.csv) only when the receiving system requires Excel’s older local text encoding.
  6. Select Save.
  7. If Excel warns that only the active sheet will be saved, confirm that you want to continue.
  8. If Excel warns that some workbook features cannot be saved in CSV format, confirm the text-file export.

Despite the word “Comma” in the format name, the saved file should now use pipes because the Windows list separator is |.

Step 4: Check the File and Restore Your Normal Separator

  1. Open the exported file in a plain-text editor, not Excel, and confirm that pipes separate the fields:
  2. Confirm that the header row and a few data rows contain pipe characters between fields.
    EmployeeID|Name|Department
    00421|Ana Lopez|Platform
  3. Return to the Windows Region dialog and change List separator back to the value you recorded earlier.
  4. Select Apply, then OK.

Keep the original .xlsx workbook. The pipe-delimited file is an export for another system, not a replacement for the editable workbook.

Convert an Existing CSV to a Pipe-Delimited File

Use this method when you cannot change Windows regional settings, need a repeatable process, or receive ordinary comma-separated CSV files from another system.

Export a True Comma-Separated CSV

If you are starting with an Excel workbook, save the active worksheet using File > Save As and choose CSV UTF-8 (Comma delimited) (*.csv) while your normal Windows list separator remains a comma.

Do not use Find and Replace to swap every comma with a pipe. A valid CSV file can contain commas inside quoted text fields:

00421,"Lopez, Ana",Platform

A simple replacement would incorrectly split the name into two fields.

Convert the CSV With Python

Create a file named csv_to_pipe.py and paste in this code:

import csv
import sys
from pathlib import Path

source = Path(sys.argv[1])
destination = Path(sys.argv[2])

with source.open("r", newline="", encoding="utf-8-sig") as infile, \
     destination.open("w", newline="", encoding="utf-8") as outfile:

    reader = csv.reader(infile, delimiter=",")
    writer = csv.writer(
        outfile,
        delimiter="|",
        quotechar='"',
        quoting=csv.QUOTE_MINIMAL,
        lineterminator="\n",
    )

    writer.writerows(reader)

Run it from the folder containing the script and CSV file:

python csv_to_pipe.py input.csv output.txt

Replace input.csv and output.txt with your actual filenames.

A CSV-aware conversion reads CSV data as structured fields and writes those fields with pipes. It keeps commas inside quoted fields intact, and it quotes any value that itself contains a pipe.

I use a plain-text editor for this rather than Find and Replace, because a CSV parser respects quoted fields and embedded commas.

If your source file uses semicolons rather than commas, change this line:

reader = csv.reader(infile, delimiter=",")

to:

reader = csv.reader(infile, delimiter=";")

Protect Data That Commonly Breaks During Export

Quoted fields preserve pipe-containing values, while exported files retain displayed values rather than workbook features.

Preserve Leading Zeros and Long IDs

Excel may interpret values such as 001234, credit-card-like strings, tracking numbers, or large identifiers as numbers. That can remove leading zeros or display a long value in scientific notation.

Before entering or importing the data, format the entire destination column as Text. For an existing worksheet, inspect the values carefully before export. If an identifier already appears as 1.234E+11, verify it against the original source rather than trusting the exported text.

Handle Commas, Pipes, and Quotation Marks Correctly

A pipe delimiter avoids problems with ordinary commas in addresses, names, and descriptions. But a value can still contain a pipe character:

Hardware|Software

A proper pipe-delimited writer encloses that value in quotes:

"Hardware|Software"

That is valid delimited-text behavior. The receiving application must parse quoted fields rather than splitting every line blindly on |.

If the destination system does not support quoted fields, choose a delimiter that cannot occur in the data, or clean and validate the source values before export.

Expect Values Rather Than Workbook Features

Delimited text stores rows and fields, not spreadsheet behavior.

Verify the Pipe-Delimited File Before Uploading

A quick visual check catches the most common problems, but verify the file using the same type of parser the receiving system will use.

Use this checklist:

  • The file opens in a plain-text editor and shows | between header fields.
  • The header has the expected field names in the expected order.
  • A few rows containing commas, quotes, empty cells, and long IDs still have the correct values.
  • Rows that contain a pipe inside a field are quoted correctly.
  • The destination importer is configured to use | as its delimiter.
  • The imported record count and column count match the expected result.

Do not judge the file only by reopening it in Excel. After you restore Windows’ normal comma list separator, Excel may display a pipe-delimited file in one column unless you import it and explicitly choose | as the delimiter.

Frequently Asked Questions

How do I change Excel’s delimiter to a pipe?

On Windows, change the regional List separator setting to |, restart Excel, and save the active worksheet through File > Save As or File > Save a Copy using a CSV format. Excel uses the Windows list separator for its CSV-style export. Restore your prior separator afterward because the setting affects other applications.

Can I save an Excel file directly as a pipe-delimited .txt file?

Excel does not normally provide a direct “pipe delimited” save type. Save the worksheet as a CSV file while the Windows list separator is |, then rename the completed file to .txt or .dat only if the receiving system requires that extension. Renaming changes the filename, not the pipe-delimited content.

Is it safe to replace commas with pipes in a CSV file?

No, not unless you know the CSV contains no quoted commas, quotes, or multiline fields. A value such as "Lopez, Ana" contains a comma that belongs to the field, not a separator. Use a CSV-aware conversion tool such as Python’s csv module so only actual delimiters are changed.

How do I create a pipe-delimited .dat file from Excel?

Create the pipe-delimited export as a .csv file first by setting the Windows list separator to | and saving from Excel. After verifying the text content, rename export.csv to export.dat if the target application requires a .dat extension. Upload or import the verified file with the target system configured for pipe-separated fields.