how can I read .dat file
20 ビュー (過去 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 で Downloads についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!