how can I read .dat file

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.

Answers (1)

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 Comments

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.
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

Sign in to comment.

Categories

Tags

Asked:

on 15 May 2019

Commented:

on 15 May 2019

Community Treasure Hunt

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

Start Hunting!