how can I read .dat file

8 次查看(过去 30 天)
Phan Duong
Phan Duong 2019-5-15
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.

回答(1 个)

Bjorn Gustavsson
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 个评论
Phan Duong
Phan Duong 2019-5-15
This is the link to download file, The file heavy than 5mb so I can not attached here.
When I use load
Error using load
Unknown text on line number 1 of ASCII file
gsmap_rnl.20010101.0.1d.daily.00Z-23Z.v6.5133.0.dat
"š^Â=öð=Pñç=ʸ“=”Q=.$>".
For "more",
Error using more
Unknown command option.
Bjorn Gustavsson
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 CenterFile Exchange 中查找有关 Downloads 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by