On Mon, Jul 15, 2002 at 02:43:14PM -0700, John W. Krahn wrote:
> Vishal Kapoor wrote:
> >
> > I want to read a few files and search for a particular word. I want to then
> > print a list of all the files with that word.
> > Any ideas ??
>
> perl -lne'/\bparticular\b/&&print($ARGV)&&close(ARGV)'
Vishal Kapoor wrote:
>
> I want to read a few files and search for a particular word. I want to then
> print a list of all the files with that word.
> Any ideas ??
perl -lne'/\bparticular\b/&&print($ARGV)&&close(ARGV)' yourfiles*
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-ma
On Jul 15, Vishal Kapoor said:
>I want to read a few files and search for a particular word. I want to then
>print a list of all the files with that word.
my @hits;
my $word = "japhy";
{
local @ARGV = @files_to_search;
while (<>) {
if (index($_, $word) != -1) {
push
On Mon, Jul 15, 2002 at 11:23:52PM +0800, Connie Chan wrote:
> my @Files = ( . ); # List of file names here.
> my @record = ( );
> my $pattern = "whatever";
>
> foreach $file(@Files)
> {open FH, $file;
> while ()
> { push @record, $file if ($_ =~ /$pattern/ig) }
> cl
ames while
contained "whatever" .
Code not tested, just for reference =)
Rgds,
Connie
- Original Message -
From: "Vishal Kapoor" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 15, 2002 10:41 PM
Subject: Reading from a bunch of files.
> Hi
Hi,
I want to read a few files and search for a particular word. I want to then
print a list of all the files with that word.
Any ideas ??
Thanx..
Vishal Kapoor
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]