73 |
|
struct field *outfmt = NULL; /* output record structure */ |
74 |
|
struct strvar *svhead = NULL; /* string variables */ |
75 |
|
|
76 |
+ |
long incnt = 0; /* limit number of input records? */ |
77 |
+ |
long outcnt = 0; /* limit number of output records? */ |
78 |
+ |
|
79 |
|
int blnkeq = 1; /* blanks compare equal? */ |
80 |
|
int igneol = 0; /* ignore end of line? */ |
81 |
|
int passive = 0; /* passive mode (transmit unmatched input) */ |
160 |
|
nbicols = 0; |
161 |
|
readfmt(argv[++i], 0); |
162 |
|
break; |
163 |
+ |
case 'n': |
164 |
+ |
incnt = atol(argv[++i]); |
165 |
+ |
break; |
166 |
|
case 'a': |
167 |
|
itype = 'a'; |
168 |
|
nbicols = 0; |
203 |
|
otype = 'a'; |
204 |
|
readfmt(argv[++i], 1); |
205 |
|
break; |
206 |
+ |
case 'n': |
207 |
+ |
outcnt = atol(argv[++i]); |
208 |
+ |
break; |
209 |
|
case 'a': |
210 |
|
otype = 'a'; |
211 |
|
break; |
332 |
|
putout(); |
333 |
|
++nout; |
334 |
|
} |
335 |
+ |
if (incnt && nrecs >= incnt) |
336 |
+ |
break; |
337 |
+ |
if (outcnt && nout >= outcnt) |
338 |
+ |
break; |
339 |
|
} |
340 |
|
fclose(fp); |
341 |
|
} |