3 #define ID_PROMPT "Station:"
4 #define DTYPE_PROMPT "DAY"
12 main(
int argc,
char *argv[])
14 FILE *
fp, *fp2, *fp3, *fp4,*fq;
29 void get_data(
char [], FILE *, FILE *,
int,
char [],
int,
int,
int,
int [],
int []);
30 void ffeed(FILE *, FILE *);
36 end_day= (date - (date/100)*100) - 1;
38 ier=
system(
"rcp lasal:/users/ftp/pub/incoming/bor/borvax.dat wasatch:/usr/db/raw/borshef/data/vax.dat");
42 printf(
"There has been an error copying\nlasal:/users/ftp/pub/incoming/bor/borvax.dat\n to wasatch:/usr/db/raw/borshef/data/vax.dat");
51 strcat(
fname,
"vax.dat");
53 if((
fp = fopen(
fname,
"r")) == NULL) {
55 printf(
"There has been an error opening %s\n",
fname);
61 strcat(
fname,
"vax.laser");
63 if((fp2 = fopen(
fname,
"w")) == NULL) {
65 printf(
"There has been an error opening %s\n",
fname);
71 strcat(
fname,
"idees.dat");
73 if((fp3 = fopen(
fname,
"r")) == NULL) {
75 printf(
"There has been an error opening %s\n",
fname);
81 strcat(
fname,
"dtypes.dat");
83 if((fp4 = fopen(
fname,
"r")) == NULL) {
85 printf(
"There has been an error opening %s\n",
fname);
91 strcat(
fname,
"vax.out");
93 if((fq = fopen(
fname,
"w")) == NULL) {
95 printf(
"There has been an error opening %s\n",
fname);
109 while(fscanf(fp4,
"%s %s\n",
dtype2[
j],
pe[
j]) != EOF)
113 while(fgets(buffer,134,
fp) != NULL)
120 sscanf(buffer,
"%*s %s", id4);
122 fgets(buffer,134,
fp);
123 sscanf(buffer,
"Data for the month of: %s %d",
month, &
year);
130 i = sscanf(buffer,
"%*s %s %s %s %s %s %s %s %s %s %s %s",
131 dtype[0],dtype[1],dtype[2],dtype[3],dtype[4],dtype[5],
132 dtype[6],dtype[7],dtype[8],dtype[9],dtype[10]);
134 fprintf(fq,
".BR SLR %4.4d Z DC%4.4d/DH06",date,date);
149 if(strcmp(
id5[l],
"GBRW4") == 0 &&
150 (strcspn(
pe[
k],
"P") == 0 ||
151 strcspn(
pe[
k],
"T") == 0))
152 memcpy(
id5[l],
"FNTW4",6);
156 if(strcmp(
id5[l],
"NVRN5") == 0 &&
157 (strcspn(
pe[
k],
"P") == 0 ||
158 strcspn(
pe[
k],
"T") == 0))
159 memcpy(
id5[l],
"BLNN5",6);
163 if(strcmp(
id5[l],
"JRRU1") == 0 &&
164 (strcmp(
pe[
k],
"DUC") == 0))
166 memcpy(
id5[l],
"DCTU1",6);
167 memcpy(
pe[
k],
"QDD",4);
172 if(strcmp(
id5[l],
"DCTU1") == 0 &&
173 (strcmp(
pe[
k],
"WEB") == 0))
175 memcpy(
id5[l],
"WPCU1",6);
176 memcpy(
pe[
k],
"QDD",4);
179 if(strcspn(
pe[
k],
"Q")==0 ||
180 strcspn(
pe[
k],
"L")==0)
183 if(strcspn(
pe[
k],
"Q")==0 &&
184 strstr(
pe[
k],
"M") != NULL)
193 start_day,
end_day,divide,conver);
202 ier=
system(
"cp /usr/db/raw/borshef/data/vax.out /tmp/queue/shef/in/vax.out");
206 printf(
"There has been an error copying\n lasal:/users/ftp/pub/incoming/bor/borvax.dat to\n/tmp/queue/shef/in/vax.out\n");
211 ier=
system(
"mpage -4b -W84 /usr/db/raw/borshef/data/vax.laser");
214 printf(
"There has been an error printing /usr/db/raw/borshef/data/vax.laser\n");
221 ier=
system(
"rcp lasal:/users/ftp/pub/incoming/bor/borvax.dat lasal:/users/ftp/pub/incoming/bor/old/borvax.dat");
225 printf(
"There has been an error copying\nlasal:/users/ftp/pub/incoming/bor/borvax.dat to\nlasal:/users/ftp/pub/incoming/bor/old/borvax.dat\n");
231 ier=
system(
"rsh lasal rm /users/ftp/pub/incoming/bor/borvax.dat");
235 printf(
"There has been an error deleting\nlasal:/users/ftp/pub/incoming/bor/borvax.dat\n");
249 if(strcmp(type,
dtype2[
i]) == 0)
272 while(fgets(buffer,134,
fp) != NULL)
276 sscanf(buffer,
"%*s %s",id4);
void ffeed(FILE *fp, FILE *fp2)
main(int argc, char *argv[])
get_data(char month[4], FILE *fp, FILE *fq, int year, char id[9], int numpe, int s_day, int e_day, int divide[10], int conver[10])
printf("fbuf is %s\n", fbuf)
fprintf(fp,"%d %d %d %d 1\n", iminx, iminy, maxi, maxj)