Delimiter Converter
← ブログに戻る

How to Convert Excel to CSV with a Pipe Delimiter for Database Uploads

June 25, 2026 847 words

Most database uploads fail not because of bad data, but because of the wrong delimiter. If your Excel file has addresses, descriptions, or any field with a comma in it, a standard CSV will break your import. Switching to a pipe delimiter solves this fast, and the process is simpler than you might think.

Why Pipe Delimiters Beat Commas for Database Uploads

Commas appear naturally in data: city and state fields, product descriptions, currency formatting. When you export a standard comma-separated file, your database parser can misread those commas as column breaks. A pipe character (|) almost never appears in real data, so it makes a much cleaner separator.

Most modern databases and import tools accept pipe-delimited files without any extra configuration. It's a small change that prevents a frustrating class of import errors.

Three Ways to Do the Conversion

You have a few solid options depending on how often you do this and how technical you want to get.

  1. Use an online converter (fastest for one-off jobs): paste your data and swap the delimiter in seconds.
  2. Use Excel's built-in export and find-replace: save as CSV, then manually swap commas for pipes in a text editor.
  3. Write a script: Python or shell commands work well if you're doing this regularly in a pipeline.

Method 1: Using an Online Tool

This is the quickest path for most people. Copy your Excel data, paste it into a comma to pipe converter, set the input delimiter to comma and the output to pipe, then download or copy the result. The whole thing takes under a minute.

If you want to avoid installing anything or writing any code, this is the approach to use. It's especially handy when someone sends you a file and you just need to prep it for a quick database upload.

💡 Tip: Before converting, check your Excel data for any existing pipe characters. They're rare, but if your data has them, you'll need to clean those out first or choose a different delimiter like a tilde (~).

Method 2: Excel Export Plus Find-Replace

First, save your Excel file as a CSV using File > Save As and choosing the CSV format. Open the resulting file in a plain text editor like Notepad or TextEdit. Then use find-and-replace to swap every comma for a pipe.

This works fine for small files. The downside is that if your data has commas inside quoted fields, a simple find-replace will break those fields too. Always preview the result before uploading to your database.

Method 3: Script It with Python

If you're handling this regularly, a short Python script is worth setting up. It handles quoted fields correctly, which the find-replace method doesn't.

  1. Read the CSV using Python's csv module with the default comma delimiter.
  2. Write the output using the same module with the pipe as the delimiter.
  3. Save the result as a .txt or .csv file, depending on what your database expects.

This approach scales to thousands of rows and handles edge cases automatically. It's the right tool if conversion is part of a recurring data workflow.

Delimiter Comparison at a Glance

Delimiter Common Use Risk in Data Database Support
Comma (,) Standard CSV exports High (appears in addresses, numbers) Universal
Pipe (|) Database imports, data pipelines Very low Widely supported
Tab (\t) TSV files, spreadsheet exports Low Widely supported
Semicolon (;) European locale CSV files Low to medium Good support

Things to Check Before You Upload

  • Confirm your database import settings are set to expect a pipe delimiter, not a comma.
  • Check that your header row is included if the database expects column names on the first line.
  • Make sure date formats match what your database accepts (YYYY-MM-DD is usually safest).
  • Remove any trailing whitespace around pipe characters, since some parsers treat that as part of the field value.
  • Test with a small batch of rows before running the full import.

Key Points

  • Pipe delimiters are safer than commas for database uploads because pipes rarely appear in real data.
  • Online tools like the online delimiter converter are the fastest option for one-off conversions.
  • A simple find-replace works for clean data, but a Python script handles edge cases like quoted commas much better.
  • Always test your pipe CSV on a small sample before a full database upload to catch formatting issues early.
  • Check your database's import settings to confirm it's configured to read pipe-delimited files before you start.

Ready to Make the Switch

Converting from a standard Excel export to a pipe CSV is one of those small changes that saves real headaches. Whether you use an online tool, a text editor, or a script, the key is making sure your output matches what your database import expects. Get that alignment right and your uploads will go smoothly every time.