#!/usr/bin/perl my $x=0;open(OF, ">OUT.txt");open(IF, "<IN.txt"); while(<IF>){if(/$ARGV[1]/){print OF "$_" if $x < $ARGV[0];$x++}} close IF;close OF;
In reply to Re: (How) can I use regex patterns to find matching lines in a textfile?
by husoft
in thread (How) can I use regex patterns to find matching lines in a textfile?
by Ritter
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |