七行プログラミングat PHP
七行プログラミング - 暇つぶし2ch288:nobodyさん
04/03/17 17:15
汎用 TSV ヴューア

#!/usr/local/bin/perl
use CGI":all";charset$C='EUC-JP';*P=*param;($f=P(f))=~/[^\w*\-.?\[\\\]]/&¨$
w=P(w)||"\t";chomp(@l=map{open(_)?grep(/\Q$w/,<_>):()}grep/$f/o&&-f,<*>)if$f;%l
=(f,"target file regex",w,"search word",o,"output file name");put(($o=P(o))?(
"Content-Type: text/tab-separated-values\nContent-Disposition: attachment;file"
."name=$o\n\n",@l):(header,start_html(-title=>'7tsview',encoding,$C,lang,ja),
table({border,1},Tr[map{td[split/\t/]}@l]),startform(0,url),p(map{$l{$_},
textfield($_,'',40).br}f,w,o),endform,end_html))


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch