现在我有一个文件要读取,是一个天气预报系统生成的数据文件,文件名是G2807508.007,不知道是什么类型,请问这样有办法读取里面的数据吗,目前只知道里面数据的原始资料格式,如下:WP3103型自动站原始资料格式以以下格式定义:
struct datarec /* 长度=100 byte */ 项序
{ unsigned char baoformat; 1
unsigned char station; 2
unsigned char stationname[6]; 3
unsigned int rec_time; 4
unsigned long rec_date; 5
unsigned int wd2dd; 6
unsigned int wd2df; 7
unsigned int wd10dd; 8
~~~~~~
自动站资料格式中各项说明
第 1项 资料类型(baoformat) 长=1 byte; 其中: “0”或0为正点报告 ,1为瞬时报告;其中瞬时报告只有正点观测数据;
第 2项 自动站编号(station);长=1 byte;数值为: 0-99等;
第 3项 自动站站号(stationname[6]);长=6 byte;
例: 59287,G1001等;
第 4项 资料时间(rec_time) 长=2 byte; 用时分表示;如: 2230 为 22时30分;
第 5项 资料日期(rec_date) 长=4 byte; 用年月日表示,如:980103 为98年1月3日;
第 6项 二分钟风向(wd2dd);长=2 byte;0-360 以度表示
~~~~~~~~
好像是用C定义的,用c#要怎样才能读取到里面的数据呢?请各位高手指点
struct datarec /* 长度=100 byte */ 项序
{ unsigned char baoformat; 1
unsigned char station; 2
unsigned char stationname[6]; 3
unsigned int rec_time; 4
unsigned long rec_date; 5
unsigned int wd2dd; 6
unsigned int wd2df; 7
unsigned int wd10dd; 8
~~~~~~
自动站资料格式中各项说明
第 1项 资料类型(baoformat) 长=1 byte; 其中: “0”或0为正点报告 ,1为瞬时报告;其中瞬时报告只有正点观测数据;
第 2项 自动站编号(station);长=1 byte;数值为: 0-99等;
第 3项 自动站站号(stationname[6]);长=6 byte;
例: 59287,G1001等;
第 4项 资料时间(rec_time) 长=2 byte; 用时分表示;如: 2230 为 22时30分;
第 5项 资料日期(rec_date) 长=4 byte; 用年月日表示,如:980103 为98年1月3日;
第 6项 二分钟风向(wd2dd);长=2 byte;0-360 以度表示
~~~~~~~~
好像是用C定义的,用c#要怎样才能读取到里面的数据呢?请各位高手指点
0 G2807 l R G F L ;9 5 T ?N ? ? 1 ?