Dear all,
I have to read to sscanf the following string: 18-11-20 22:25:00.000 BRUX XXX 2 0 0 0 4027896.395
I tried with the format specifier %02i-%02i-%021 %02i:%02i:%02.3f %s %s %i %i %i %i %.3f, but only the first int till 25 are correctly read. After that no other data are read. Any suggestion?
Thanks

댓글 수: 2

Luna
Luna 2018년 11월 23일
편집: Luna 2018년 11월 23일
Write down what have you done with sscanf so far and what you expect to get as a result.
madhan ravi
madhan ravi 2018년 11월 23일
first upload your file which has to be read

댓글을 달려면 로그인하십시오.

 채택된 답변

Stephen23
Stephen23 2018년 11월 23일

0 개 추천

>> str = '18-11-20 22:25:00.000 BRUX XXX 2 0 0 0 4027896.395';
>> sscanf(str,'%f-%f-%f%f:%f:%f %*s %*s%f%f%f%f%f')
ans =
18.00000
11.00000
20.00000
22.00000
25.00000
0.00000
2.00000
0.00000
0.00000
0.00000
4027896.39500

추가 답변 (1개)

Roberto
Roberto 2018년 11월 23일

0 개 추천

Thanks,
such solution provides only float numbers, but that's fine for me.

카테고리

도움말 센터File Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기

태그

질문:

2018년 11월 23일

답변:

2018년 11월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by