...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);
In reply to Re^5: Processing .RES file
by arun_kom
in thread Processing .RES file
by raghvens
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |