Code:
#include <stdio.h>
typedef struct{
int Time[240];
float DryTempC[240], DewPointC[240];
int RH[240];
}MONTH;
MONTH month[240];
void read_data();
int main()
{
read_data();
}
void read_data()
{
int store;
int i,j;
int Jday;
FILE * pFile;
pFile = fopen ("KBIS_2005.txt","r");
for(i=0;i<=239;i++)
{
fscanf(pFile,"%d""%f""%f""%d\n",&month[i].Time[j], &month[i].DryTempC[j], &month[i].DewPointC[j],&month[i].RH[j]);
printf("%3d""%4.1f""%4.1f""%3d\n",month[i].Time[j], month[i].DryTempC[j], month[i].DewPointC[j], month[i].RH[j]);
}
fclose(pFile);
}
the file is something like this:
"Time" "DryTempC" "DewPointC" "RH" "Day" "Year" "Month" "Jday"
0 0.6 -5 67 1 2005 5 121
1 0 -3.9 75 1 2005 5 121
2 0 -3.9 75 1 2005 5 121
3 0 -3.9 75 1 2005 5 121
4 0 -4 75 1 2005 5 121
5 -1.1 -3.9 82 1 2005 5 121
6 0 -3.9 75 1 2005 5 121