Saturday, February 5, 2022

[SOLVED] Replace CSV delimiter by pipe character

Issue

I need to change CSV delimiter -> ',' (comma) to '|' (pipe).

I'm not able to blindly replace all comma characters by pipe character since some values contain comma characters.

Any ideas?


Solution

Use csvkit, you can change your delimiter safely:

https://csvkit.readthedocs.io/en/latest/

csvformat -D '[your delimiter here]' [file name]


Answered By - aldegalan
Answer Checked By - Willingham (WPSolving Volunteer)