Transform the separators of a CSV file

CSV file image

CSV file imageThe CSV Comma Separated Values) files are text files that describe a table. Columns are identified on a line of text by a particular character. For CSV it is normally a comma (comma). The common separators are:

  • comma (,)
  • semicolum (;)
  • tabulation (\t)
  • space ( )

We often use Excel to open the CSV, and we use the save or export to change the type of separator. But not all formats are supported (comma separator for example!)

That’s why I’m offering here a small, free and open source command-line tool that allows you to perform the “Separated Values” file transformation from and to the separators listed above.

So to transform the CSV (comma separated values) example.csv file to TSV (tab separated values) we will use the command:

CSVTransformer.exe exemple.csv comma exemple.txt tab

The syntax of the command is:

type CSVTransformer.exe to get help:

CSV Transformer 1.0.0.0 (c) 2018 Franck Gaspoz http://franckgaspoz.fr

command line syntax: inputFile inputFileFormat outputFile outputFileFormat [opts]

inputFileFormat,outputFileFormat: csv | semicolon | tab | space

opts :

-q : supress all outputs except errors

how to get the tool?

The binary is available for download on this site. Use the following link to download CVSTransformer.exe :

CSVTransformer

The source code is placed in a public repository on GitHub at:

https://github.com/franck-gaspoz/CSVTransformer.git

To learn more about the GitHub project, go to the project wiki page on GitHub

One thought on “Transform the separators of a CSV file

Comments are closed.