看板
[ Perl ]
討論串[問題] print 特定段落
共 6 篇文章
內容預覽:
#!/usr/bin/perl -w. use strict;. my $txtflag=0;. open FH, "test.txt";. while (<FH>){. $txtflag=1 if /^sage\s\d+\sP/i;. print "$_" if (/^\s*name/ || /^
(還有690個字)
內容預覽:
print unless /stage\s\d+/; 就可以獲得以上結果. 如果檔案結構變成, 如下. open file "<test.txt"; -------> output results. sage 1 g sage 2 P. {. name "..............." name
(還有608個字)