Convert Commas to Pipes
Swap commas for pipes. Pipe-delimited files are the standard in a lot of legacy and financial systems.
Examples
| Input | Output | |
|---|---|---|
| Simple | apple,banana,cherry |
apple | banana | cherry |
| Realistic | userid,event,ts |
userid | event | ts |
Why convert this way
Pipes almost never appear in real text. That is why banks, telecoms and log formats favour them: no quoting, no escaping, no ambiguity. A name, an address or a product description will contain commas long before it contains a vertical bar.
When you will need it
- Feeding a legacy import that specifies pipe-delimited
- Writing log lines you will later parse with
cut -d'|' - Avoiding quote-escaping in data full of commas
- Flattening records into a single audit-log column
a|b and a | b parse differently in strict importers — many will keep the surrounding spaces as part of the value.
What the settings do here
- Split on comma — the tool reads
apple,banana,cherryas 3 separate items. - Join with |
— producing
apple | banana | cherry.
Where this comes up
Common when handing data to a system somebody built in 2004. Pipe-delimited specifications are still standard in banking and telecoms precisely because they predate reliable CSV quoting and never needed it.
Related conversions
Going the other way, or joining with something else entirely? The delimiter converter accepts any split and join pair including custom separators, and the index has the 16 ready-made ones.
Frequently Asked Questions
Why use pipe-delimited instead of CSV?
Because a vertical bar almost never occurs in real text. Banking, telecoms and log formats favour pipes so that values containing commas need no quoting or escaping.
Should there be spaces around the pipe?
It depends on the reader. Strict importers treat a | b as values with trailing and leading spaces, while a|b is clean. Decide before you generate the file.