I am running the code in cygwin and here is my complete code.
#!/bin/perl5.8.6 use warnings; use diagnostics; use File::Basename; @files = <../tryremove/*>; #This is the destination path where the comment removed files are crea +ted. $path1 = "C:/Projects/tryremove/c"; foreach my $file (@files) { my $filename =basename($file); open(file1,"$file") or die "The file cannot be opened the $file:$!\n +"; open(file2,">$path1/$filename") or die "The file cannot be opened:$! +\n"; while(!eof(file1)){ $/ = undef; $_ = <file1>; s# .* report [s]? .* ; .* ##sx; print file2 ($_); } close(file1); close(file2); }
In reply to Re^4: text matching
by prassi
in thread text matching
by prassi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |