On Fri, 25 Oct 2002 11:11:53 -0400, [EMAIL PROTECTED] wrote:
>Vladi Belperchinov-Shabanski <[EMAIL PROTECTED]> writes:
>=>    #!/usr/bin/perl -n
>=>    $c = 50 if /CREATE TABLE/;
>=>    print if $c and $c--;

The solution above works even if CREATE TABLE is repeated within 50 lines,
the solution below does not.

>This seems to work:
>
>    || perl -ne 'print if /CREATE TABLE/ .. (++$c > 50)' nine-megs.txt

Reply via email to