How to load a .dat (comma-separated)

How can I read a file in .dat format, which has three commas in each row and only the second is a separator? The others are decimal separators.
Maybe I do not explain my problem sufficiently, so I attach the mentioned file.

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 14 de Abr. de 2016
v=importdata('1.dat')
w=v(1:2:end)
out=regexprep(w,'(?<=\S+,\S+),', ' ')

2 comentarios

Denis Dudas
Denis Dudas el 14 de Abr. de 2016
Thank you for your quick answer. Please, what would be different if I need to remove all the commas?
Azzi Abdelmalek
Azzi Abdelmalek el 14 de Abr. de 2016
Editada: Azzi Abdelmalek el 14 de Abr. de 2016
out=regexprep(w,',', ' ')

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Import and Analysis en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 14 de Abr. de 2016

Editada:

el 14 de Abr. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by