in reply to Re: text file search and replace
in thread text file search and replace
$COMPFILE = IO::File->new; $TMP = IO::File->new; $COMPTMPLT= IO::File->new; $COMPFILE->open("< comp_no_rods.txt" or die "Can't open"); $COMPTMPLT->open("< comp_template.txt" or die "Can't open comp_templat +e"); $TMP->open("> tmpfile.txt" or die "Your TMP file sucks"); until ($COMPFILE -> eof){ $compline = $COMPFILE->getline(); if ($compline !~ /END/){ print $TMP "$compline"; } } $TMP->open(">> tmpfile.txt" or die "Your TMP file sucks"); until ($COMPTMPLT -> eof){ $tmpltline = $COMPTMPLT->getline(); print $TMP "$tmpltline"; }
|
|---|