-
Notifications
You must be signed in to change notification settings - Fork 0
/
Drawgrp.c
55 lines (40 loc) · 1.24 KB
/
Drawgrp.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "stdio.h"
main()
{
char JBFile[256];
char OutFile[256];
int i,n,JBShot;
char group[2512];
long FileNumber,ByteShot;
FILE *fpJB,*fpShotLine,*fpFileName;
// Give file name here:
JBFile=" ";
FileNumberFile=" "
OutFile=" ";
// Get the shot point number here:
ByteShot=2512*410;
fpJB=fopen(JBFile,"r");
fseek(fpJB,0,2);
i=ftell(fpJB);
JBShot=i/(2512*410);
fpShotLine=fopen(OutFile,"w");
fpFileName=fopen(FileNumberFile,"r");
for(shot=0;shot<20;shot++){
fscanf(fpFileName,"%ld\n",&FileNumber);
for(i=0;i<JBShot;i++){
pos=i*ByteShot+4;
fseek(fpJB,pos,0)
fread(&n,sizeof(long),1,fpJB);
if(n==FileNumber){
pos=i*ByteShot;
fseek(fpJB,pos,0);
fread(group,sizeof(char),2512,fpJB);
fwrite(group,sizeof(char),2512,fpShotLine);
}
}
}
fclose(fpShotLine);
fclose(fpJB);
return;
}
JBFile