Hi

I have a file which contains a number of instances of the word "FINAL".
I need to truncate all the instances of this word and create an output
string of the rest of the words in the same line in the file. Rest all
lines not containing the word are to be ignored. For this I have written
a code as follows:


while(<OUT1>) {

        if(/FINAL/) {
                chomp($_);
                $_ =~ tr/FINAL//d;
                $sec_seq1 = $sec_seq1 . $_;
        }

}

I have also tried something like this:

while(<OUT1>) {
        if(/FINAL/) {
                chomp($_);
                $_ =~ s/FINAL//g;
                $sec_seq1 = $sec_seq1 . $_;
        }
}
$sec_seq1 =~ tr/ +$//d;

but it still leaves spaces in all the occurences of the word. Is there
some problem with this code ?

Thanks in advance.
Manas.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to