作者handsomegirl (薰)
看板perl
標題[問題] format與write
時間Tue Sep 4 15:56:58 2007
想用格式化輸出檔案,
不過都只能print在cmd window上
什麼方法才可以寫到檔案裡去呢?
附上code
#!usr/bin/perl
format STDOUT_TOP=
Pname Max Min Avg Std Stdplus Stdless
================================================================================
.
format STDOUT=
@>>>>>>>> @##### @#### @#####.#### @#####.#### @#####.#### @#####.####
$_[0],$_[1],$_[2],$_[3],$_[4],$_[5],$_[6]
.
open f,"+<c:\\test\\1\\stastical3.txt";
while(<f>){
chomp;
split(/\s+/);
unshift @value,$_;
($_[0],$_[1],$_[2],$_[3],$_[4],$_[5],$_[6])=split/\s+/;
write ;
}
close f;
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.65.55.161
1F:推 iAuEx:用select? 09/05 12:21