#include "stdio.h" #include "string.h" #include "flatfile.h" #include "astring.h" #include "stdlib.h" void main(int argc, char *argv[]) { FILE *fpout; char filein[100]; char *vn, *vu, *vs, *vt, no[1000], *vars; char stime[24],etime[24], ctime[24], ch; double suttime, euttime, uttime[1]; int inunit, outunit, ncol[1], csize[1], error, done, subdone,i; long srow, erow, nrow[1], orow, irow, crow, rows; float *data; if (argc < 2) { printf("Enter flat file to copy : "); gets(filein); } else { strcpy(filein,argv[1]); } inunit = ffopen(filein); vn = calloc(sizeof(char),ff_ncol[inunit]*16+2); vars = calloc(sizeof(char),ff_ncol[inunit]*16+2); vu = calloc(sizeof(char),ff_ncol[inunit]*16+2); vs = calloc(sizeof(char),ff_ncol[inunit]*31+2); vt = calloc(sizeof(char),ff_ncol[inunit]*2+2); data = calloc(sizeof(float),ff_ncol[inunit]); error = rdhead(inunit,vn,vu,vs,vt,no, stime,etime,nrow,ncol,csize); strcpy(vars,strmid(vn,0,13)); for (i=1;i= nrow[0]-1) { subdone = 1; done = 1; } } irow = irow + crow; if (!done) { printf("press enter for more data; q to quit"); ch = getchar(); if ((int) ch == (int) '\n') rows = 47; if ((int) ch == (int) 'q') done =1; } } ffclose(inunit); }