Azure Machine Learning insists me to use comma as deliminator in CSV files, instead of semicolon. This breaks a lot of things in *ix computers where we use semicolon and cell values have a lot of commas.

What are proper way to escape characters or replace all commas in the cells? Does there exist some Unix tools to escape or help in this format issue and possible conversions?

  • Comma-separated values (CSV) breaks what?
    – zedman9991
    Jan 25 '17 at 19:17
  • @zedman9991 the semicolon was unique separator but now the comma, as a separator, is not unique so how to escape it properly? How to find other unique character for the commas in the cell values? How to differentiate field separating commas and cell value commas properly?
    – hhh
    Jan 25 '17 at 19:36

If you have commas within fields, then the CSV file generated should produce some way of delineating fields from those commas. For example, this is often done by putting quotes around such fields:


Otherwise there is no way to tell what separates a field vs what is part of that field. This problem exists no matter what character you choose.

You can search and replace those items with your own character if you want, like in the example above:

sed -e 's/","/"~"/g' csvfile

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .