Replace Pipes with Tabs in a Delimited File


It is often necessary to replace delimiters in a file with a form the receiving party expects. sed is my favorite method of meeting the need.


Replace double pipes with tabs

sed 's/||/           /g' > file.out

Note: If you find the tab key simply does not work, try CTRL+V+I from your terminal.



Special consideration (and a regex) will be required for data where delimiters are present in the data itself. Consider your use case and apply appropriately.