Hi all, Can any one tell me how to parse all the files (*.txt ,*.xml etc) in a folder by taking the folder name as argument and to search for a particular word in that files , I want to write a perl scipt for this, pls give me some pointers. Regards, Anoop4real
Dear Friend, The following coding is used to give your requirement Code: use strict; use warnings; use Data::Dumper; my $var; foreach(@ARGV) { opendir(DIR,$_); my @array=readdir(DIR); foreach(@array) { $var=$_; if($var=~/(\.txt|\.xml)/) { system("grep -lh 'welcome' $var"); } } } :crazy:
Mr.Murugaperumal Why you are posting same answer twice? Before Submit your answer see your Preview Image