Skip to content

Guide to use CSVToCustomDSV

Hemanth B edited this page Jul 23, 2017 · 1 revision

Welcome to the CSVToCustomDSV wiki!

Converting CSV file to DSV file using column and cat command

First take a sample csv (Ex: ESS.csv)

ESS.csv is comma separated file with left and right enclosure is """ and field separator is ","

To convert the ESS.csv file to delimited file(i.e dsv) using column command use below command

cat ESS.csv | column -t -s '"' -o '' | column -t -s ',' -o ';' > ESS.dsv

Command Explanation:

Above command changes left and right enclosure from " to none and field separator is ";"

You can customize left enclosure as per your requirements

Example 2:

Change left and right enclosure from """ to "'" and field separator is ";"

cat ESS.csv | column -t -s '"' -o ''' | column -t -s ',' -o ';' > ESS.dsv

Example 3:

Change left and right enclosure from "'"" to ":" and field separator is ";"

cat ES.csv | column -t -s \'\'\' -o ':' | column -t -s ',' -o ';' > ES.dsv

Clone this wiki locally