in reply to Re: (How) can I use regex patterns to find matching lines in a textfile?
in thread (How) can I use regex patterns to find matching lines in a textfile?

I am using WinXP... with perl -ne 'print if /pattern/ and $i++ < 100 ' myfile.txt I just get a message "The file can't be found" :( Ritter
  • Comment on Re: Re: (How) can I use regex patterns to find matching lines in a textfile?
  • Download Code

Replies are listed 'Best First'.
Re: Re: Re: (How) can I use regex patterns to find matching lines in a textfile?
by jmcnamara (Monsignor) on Nov 20, 2002 at 12:35 UTC

    Windows requires double quotes. This should work:     perl -ne "print if /pattern/ and $i++ < 100" file.txt

    --
    John.