Finding a certain string on each line in a file

Hi,

I need a script to get every line from a file where there are less then
17 ; on a line.

Thank's

What does your input file look like ?

like this

316916164;20030306;D;N;;N;19821027;;0575546109;0575491277;;N;IA9556577;NL0;1;Q;Y;
316916200;20030306;D;O;;N;19750424;;;;;R;3030760293;NL0;2;Q;N;
316916211;20030306;D;O;;N;19801212;;0302100013;;;R;3197406341;NL0;1;Q;N;
316916222;20030306;C;O;;N;;;;0525682150;080104710000
;;;;2;J;N;
316916233;20030306;D;O;;N;19790129;;0654385347;0582449781;;P;N75375270;NL0;2;Q;N;
316916244;20030306;D;O;;N;19820719;;0411641243;;;P;N73012331;NL0;1;Q;N;
316916255;20030306;D;N;;N;19730514;;0263704505;;;P;M12128545;NL0;2;Q;N;
316916266;20030306;D;N;;N;19800424;;003289715898;;;P;M20569307;NL0;1;Q;Y;

awk -F";" '{ if ( NF < 17 ) print $0 }' input.file

Great works,
1 question , instead of on the screen i would like the line's in a another file

Thanks

Redirect it to another file

awk -F";" '{ if ( NF < 17 ) print $0 }' input.file > output.file