in reply to Re: Open a file, search for a string and fill a string in another file
in thread Open a file, search for a string and fill a string in another file

I"ve written the code for the above, but i'm stuck at a point to replace the line the result file with the line i want. Please help. Below is my code:
my $ldir = "/Android"; $RESULTS_FILE = $ldir.'/'.'results.html'; open OUT, ">>", $RESULTS_FILE; open(IN,"<logcat.txt"); while(<IN>) { chomp; if( $_ =~ m/Unable to parse/ ) { my @string = split('/',$_); print @string; my $stream_name = $string[4]; while $srch(<OUT>) { chomp; if( $srch =~ m/$stream_name/ ) { // How to replace the line here? } } } }
  • Comment on Re^2: Open a file, search for a string and fill a string in another file
  • Download Code