replace comma by dot

307 views (last 30 days)
shaz
shaz on 20 Oct 2012
Commented: Abdou Suso on 29 Apr 2021
i have a csv file where comma is present in place of dot
this file needs to be imported to matlab & needs to replace comma by dot
  4 Comments
Sandy Ramírez
Sandy Ramírez on 10 Sep 2020
Muy buena e importante la intervención con respecto a los signos de puntuación es importante tenerle respeto a la escritura..

Sign in to comment.

Accepted Answer

Jan
Jan on 20 Oct 2012
Data = fileread(FileName);
Data = strrep(Data, ',', '.');
FID = fopen(NewFileName, 'w');
fwrite(FID, Data, 'char');
fclose(FID);
  7 Comments
Abdou Suso
Abdou Suso on 29 Apr 2021
It worked perfectly for me. Thanks for the bost

Sign in to comment.

More Answers (1)

Carlox Velez
Carlox Velez on 1 Apr 2016
It work super well and is a very fast solution Thanks for the answer Carlos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!