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 Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

태그

질문:

2016년 4월 14일

편집:

2016년 4월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by