Hello all. I am trying to find a way to import data from .data file. Is there a function that imports .data file or should I convert .data file to something else?

 Accepted Answer

Jan
Jan on 16 May 2021

1 vote

Remember, that ".data" is a part of the file name, which can be choosen freely. It does not tell anything about the internal format. There is not general rule how ".data" files have to look like, if they are text or binary files. Therefore it is impossible to guess, how the files have to be imported.
Ask the person, who have created these files. Posting asmall example of the contents might be useful also.

4 Comments

Thank you for the information. I could not attach the file because it is over file size limit. I think I have to ask the person who created the file. Thank you and have a nice day!
Actually, I found the metadata of the file. Based on this information, is there a way to import this .data file? The content of the metadata is below.
DSET t2m.data
undef -999.
TITLE ECMWF monthly 2m air temperature
* ------------------------------------------------------------------
*OPTIONS big_endian
*
XDEF 240 LINEAR 0.0 1.5
*
YDEF 48 LINEAR 19.5 1.5
*
ZDEF 1 LINEAR 3. 3.0
*
TDEF 432 LINEAR 01Jan1979 1mo
*
vars 1
t2m 0 11,1,0 ** 2m air temperature
ENDVARS
Jan
Jan on 16 May 2021
You want to import a file called "XYZ.data". We cannot know, how these files look like. Instead of howing us its contents, you mention another "metadata" file. The relation between the "metadata" and the "data" file is not clear. The readers cannot guess, how the file formats are defined.
Find the required information in the dodumentation of the software, which creates these files, or ask the authors of this software.
I guess the metadata file is just supplementary information of the t2m.data file. I think I just have to ask the author of the file. Thank you for the comments.

Sign in to comment.

More Answers (0)

Asked:

on 16 May 2021

Commented:

on 16 May 2021

Community Treasure Hunt

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

Start Hunting!