Http://funds.bbs.hexun.com/viewarticle.aspx? Aid = 35686444 & bid = 7
The big Smart Data Structure found on the internet is as follows:
Big Smart Data File and data structure: (assume that the big smart stock market software is installed in the D:/GP/Dzh directory)
Shanghai Daily storage path: D:/GP/Dzh/data/shase/day, File Extension:. Day
Shanghai Weekly online storage path: D:/GP/Dzh/data/shase/week, File Extension:. wek
The storage path of the monthly subscription in Shanghai is D:/GP/Dzh/data/shase/month, and the file extension is. MNT.
The storage path of the Shenzhen daily route is: D:/GP/Dzh/data/sznse/day.
The storage path of the Shenzhen weekly route is: D:/GP/Dzh/data/sznse/week.
The storage path of the month line in Shenzhen is: D:/GP/Dzh/data/sznse/month.
Week line. The format of the month line is the same as that of the day line.
The length of each record is 40 bytes:
1-4 bytes are the date, and the format is converted to decimal: 19910102
5-8 bytes = open bandwidth (RMB) * 1000
9-12 bytes = maximum price (RMB) * 1000
13-16 bytes = lowest price (yuan) * 1000
17-20 bytes = closing price (RMB) * 1000
21-24 bytes = Transaction amount (RMB)/1000
25-28 bytes = Transaction volume (hand)
The remaining 12 bytes are not used
I wrote a small C-language program for everyone and hoped it would be useful.
Steps:
Defines the data structure of a stock price gpjg
Use fread function to read files
Use the fprintf function to write files
The final result of the program execution is to convert the binary file into a comma separated character file, which is suffixed with .csv and can be opened in Excel or processed subsequently.
The procedure is as follows:
# Include <stdio. h>
# Include <stdlib. h>
Struct gpjg
{
Unsigned long int RQ;
Unsigned long int KP;
Unsigned long int ZG;
Unsigned long int ZD;
Unsigned long int sp;
Unsigned long int cjje;
Unsigned long int cjl;
Unsigned long int L1;
Unsigned long int L2;
Unsigned long int l3;
} Gpjg1;
Main ()
{File * FP;
File * FP1;
Int I;
If (FP = fopen ("D: // GP // Dzh // data // sznse // day // 184721.day"," rb ") = NULL)
{Printf ("cannot open file/N ");
Return;
}
If (FP1 = fopen ("184721.csv"," W ") = NULL)
{Printf ("cannot open file/N ");
Return;
}
For (I = 0; I <10000; I ++ ){
Fread (& gpjg1, sizeof (struct gpjg), 1, FP );
If feof (FP) {return ;}
Printf ("% lu, % lu/N", gpjg1.rq, gpjg1.kp, gpjg1.zg, gpjg1.zd, gpjg1.sp, gpjg1.cjje, gpjg1.cjl );
Fprintf (FP1, "% lu, % lu/N", gpjg1.rq, gpjg1.kp, gpjg1.zg, gpjg1.zd, gpjg1.sp, gpjg1.cjje, gpjg1.cjl );
}
}