[問題] 關於插入空行
現在有個檔案~因為格式的關係
想要在第21行插入三行空白行
有辦法可以做嗎???
因為我現在插入空行的方式,他會讓每一行中間都隔了三行
謝謝大家指教~
chdir "c:\\Perl\\Cp";
@muti=glob("*.t*");
foreach (@muti)
{
open (FILE,$_);
@file=<FILE>;
close FILE;
foreach $file(@file)
{
open f,">>c:\\Perl\\Cp\\new\\$_";
$no=10;
while(chomp $file){
if($file!~/^\d\d\s/){
for (reverse @array){
print f $no++;
print f "\n\n\n";
print f " ".$_.$/ ;
}
print f "$file\n" ;
undef @array;
next ;
}
undef @s_line;
push @s_line,reverse@{[split//,$file]}[2..$#{[split//,$file]}];
push @array,join('',@s_line);
}
}
}
close f;
--
出清衣櫃中~~歡迎參觀
http://class.ruten.com.tw/user/index00.php?c=&m=&o=&p=&s=jwce1021
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.65.55.161
推
05/22 17:37, , 1F
05/22 17:37, 1F
※ 編輯: handsomegirl 來自: 61.65.55.161 (05/22 17:44)
→
05/22 17:44, , 2F
05/22 17:44, 2F
→
05/22 20:50, , 3F
05/22 20:50, 3F
→
05/22 20:51, , 4F
05/22 20:51, 4F
→
05/22 20:52, , 5F
05/22 20:52, 5F
→
05/23 09:28, , 6F
05/23 09:28, 6F
Perl 近期熱門文章
PTT數位生活區 即時熱門文章