how can I read .dat file
조회 수: 1 (최근 30일)
이전 댓글 표시
I want to read data from .dat file, I use code:
A=fopen('gsmap_rnl.20010101.0.1d.daily.00Z-23Z.v6.5133.0.dat');
tline=fgetl(A)
but the result I receive like that
tline =
'š^Â=öð=Pñç=ʸ“=”Q=.$> ëê>jy‘>r.>•S->]\>Kï*>Êu5>Ʊ/>7>àÌ€>þ;¥>íë=>ëúS>û¡>¸
I think the data is encrypted.
I also try with
A=importdata('gsmap_rnl.20010101.0.1d.daily.00Z-23Z.v6.5133.0.dat');
A.data
but the ans is 5.
How can I read the file?
Thanks.
댓글 수: 0
답변 (1개)
Bjorn Gustavsson
2019년 5월 15일
What is the data format? Do you have a file? Is it reasonably sized? Could you share it?
If you type:
more gsmap_rnl.20010101.0.1d.daily.00Z-23Z.v6.5133.0.dat
at the prompt in your standard shell what does the file look like? Does the file have some sort of header/meta-data? Do you have the format specification?
Does it work to simply use load:
>> load gsmap_rnl.20010101.0.1d.daily.00Z-23Z.v6.5133.0.dat
So many questions!
댓글 수: 2
Bjorn Gustavsson
2019년 5월 15일
more is a unix-command for looking at files.
Apparently your file is in some sort of binary format. For reading such files you need to know the format, or have a function that reads said format. The easiest way to get such a function or information about the file-format is from the people/organization from which you got the file. It might be possible to reverse-engineer the file-format (I'm doubtful about that). But I don't think you will not find anyone here that can do it "just like that" and for free.
HTH
참고 항목
카테고리
Help Center 및 File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!