-1

i want to read data between two strings and paste into new file....

open ($gen_xml,">test.xml") or die "can not open file $gen_xml : $!\n" ;

$i='start';
$j='end';
while($line = <$fh>){
    if ($line =~ /$i/../$j/) 
        { print $gen_xml $line; }
}
4

1 回答 1

0

只需在 print 语句上方的代码中添加以下两行

$line=~s/$i//;
$line=~s/$j//;
于 2013-05-15T04:25:47.667 回答