>#include <stdio.h> >main(int argc, char * argv[]) >{ > int c; > int cr=0x0d; > int lf=0d0a; > FILE *in, *out; > printf("argument count: %d",argc); > if ( argc < 4 ) { puts("Usage: setrec.exe (number of bytes for each record) (input file) (output file)"); } > printf("operation beginning on: %s->%s\n",argv[2],argv[3]); > in = fopen(argv[2], "rb"); > if ( in == NULL ) { printf("Could not open input file,\nUsage: setrec.exe (number of bytes for each record) (input file) (output file)"); } > out = fopen(argv[3], "wb"); > if ( out == NULL ) { printf("Could not open output file,\nUsage: setrec.exe (number of bytes for each record) (input file) (output file)"); } > for (int count=1; c=fgetc(in)!=EOF ; count++) > { > if ( count==(argv[1])) /* if bytes read is same as expected. */ > { > fputc(c,out); > fputc(cr,out); > fputc(lf,out); > count=-1; > } > else > { > if (c==cr || c==lf) > { > count=0; > } > else > { > fputc(c,out); > } /* end of inner if else loop */ > } /* end of if else loop */ > } /* end of for loop */ > fclose(in); > fclose(out); > printf("operation completed on: %s->%s\n",argv[2],argv[3]); >} > >>Now lets do it in VFP ...