I need to convert comma ',' to dot '.'

61 visualizaciones (últimos 30 días)
matt sss
matt sss el 10 de Jun. de 2021
Comentada: Sulaymon Eshkabilov el 10 de Jun. de 2021
Hi, I have a set of txt files that contain only a set of numbers that have decimals, but have a comma and not a dot as a separator (for example, there is 1567,987 and not 1567.987). Is there a script that allows you to do this conversion?
I could use matlab's "find & replace" option and import the files later, however, since there are so many files I would like to do something more automated with a script.

Respuestas (2)

Sulaymon Eshkabilov
Sulaymon Eshkabilov el 10 de Jun. de 2021
Editada: Jan el 10 de Jun. de 2021
  2 comentarios
Jan
Jan el 10 de Jun. de 2021
I can confirm, that this is a good advice. :-)
Sulaymon Eshkabilov
Sulaymon Eshkabilov el 10 de Jun. de 2021
Thanks Jan :)

Iniciar sesión para comentar.


Star Strider
Star Strider el 10 de Jun. de 2021
One option in detectImportOptions (introduced in R2016b and updated in later releases) in Parameters for Text Files Only allows the definition of:
'ThousandsSeparator' — Characters that indicate the thousands grouping
and:
'DecimalSeparator' — Characters indicating decimal separator
There is no direct URL for these, so click on the second link and scroll down to them.
.

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by