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.

 Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 14 Apr. 2016

0 Stimmen

v=importdata('1.dat')
w=v(1:2:end)
out=regexprep(w,'(?<=\S+,\S+),', ' ')

2 Kommentare

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Import and Analysis finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by