in reply to Re^4: Processing .RES file
in thread Processing .RES file

...hopefully this does what you need

use strict; use warnings; open(OUT, '>', "out.txt"); open(FH, "test.res") or die "$!"; while(<FH>){ chomp; if($_ =~ m/--gnu.+-D/){ my @words = split(/\s+/, $_); foreach my $word(@words){ if($word =~ m/^-D/){ print OUT "$word\t"; } } last; } } close(FH); close(OUT);

Replies are listed 'Best First'.
Re^6: Processing .RES file
by raghvens (Novice) on Oct 04, 2009 at 01:50 UTC
    Hi Arun, Many Thanks, It works fine. Thanks a lot for your help.