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.

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 4 月 14 日

0 投票

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

2 件のコメント

Denis Dudas
Denis Dudas 2016 年 4 月 14 日
Thank you for your quick answer. Please, what would be different if I need to remove all the commas?
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 4 月 14 日
編集済み: Azzi Abdelmalek 2016 年 4 月 14 日
out=regexprep(w,',', ' ')

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Import and Analysis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by