
wickedxter
User
Sep 22, 2011, 3:14 PM
Views: 3628
|
|
Re: [manojrayan] Urgent Help
|
|
|
my @words = qw(data set); open FILE1, "file.txt"; my @file = <FILE1> close FILE1; open FILE2, ">>file2.txt"; foreach (@file){ foreach my $word (@words){ if($word eq $_){ print FILE2 uc($_); }else { print FILE2 $_; } } } close FILE2 NOTE: untested this is a baisc attempt this is used for small files to search. depending on what word your looking for you might have to adjust the if statement to better suit your needs.
(This post was edited by wickedxter on Sep 22, 2011, 3:17 PM)
|