[問題] 重複replace的問題
*********************************code
$file = $ARGV[0];
$replace = $ARGV[1];
open(FILE,"<$file") or die "$file not found!!";
while( $line = <FILE> )
{
chomp($line);
$line =~ s/stand\.tmp/$replace\.tmp/;
$line =~ s/stand\.tmp2/$replace\.head/;
$line =~ s/stand /$replace /;
print "$line\n";
}
close(FILE);
**************************************************************
原稿
perl subckt1.pl LVDSTX_frame.cir stand > stand.tmp
perl subckt2.pl stand.tmp stand > stand.tmp2
希望得到
perl subckt1.pl LVDSTX_frame.cir Sedes > Sedes.tmp
perl subckt2.pl Sedes.tmp Sedes > Sedes.head
小弟是新手 目前的code 可以得到我要的結果
但是我想要取代的 replace name 一共有1000多筆
我希望能用一個list table 直接去執行他
請問要怎樣才能做這件事 謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.202.87.29
推
04/11 23:32, , 1F
04/11 23:32, 1F
→
04/11 23:34, , 2F
04/11 23:34, 2F
→
04/11 23:35, , 3F
04/11 23:35, 3F
→
04/15 10:59, , 4F
04/15 10:59, 4F
Perl 近期熱門文章
PTT數位生活區 即時熱門文章