
mar85
Novice
Apr 9, 2013, 10:30 PM
Views: 759
|
Re: [mar85] Need Help in Report File Handling
|
|
|
This is the body of my script right now:
use Getopt::Long; GetOptions( "txt_path:s" => \$txt, "output_txt_path:s" => \$out_txt ); chomp($txt); chomp($out_txt); $out_txt =~ s/^\s+//; #remove leading spaces $out_txt =~ s/\s+$//; #remove trailing spaces open(IN_TEXT,$txt); my @txt_contents = <IN_TEXT>; close(IN_TEXT); foreach (@txt_contents) { if ( $_ =~ m/FRUITS/g) { my $filtered_content = custom_subroutine($_); push(@Sorted_Content,$filtered_content); } } open(IN_OUTPUT_FILE,">$out_txt.txt"); foreach (@Sorted_Content) { print IN_OUTPUT_FILE; }
(This post was edited by mar85 on Apr 9, 2013, 10:32 PM)
|