Re: [請問] 許多文字檔只抓其中一行?

看板RegExp (正規表示式 Regular Expression)作者 (當你孤單會想起誰)時間14年前 (2011/01/27 18:09), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
若用linux-like 系統 可以寫 shell script #!/bin/bash dir="your text file dir" output="out.o" for i in $dir/* do #get file name filename=${i##*/} #remove 附檔名 filename=${name%.*} #output filename into $output echo $filename >> $output #get the line which in last fifth. tail -n 5 $i | head -n 1 >> $output; done ps. windows下可灌cygwin -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.109.183.71
文章代碼(AID): #1DGKHFPE (RegExp)
文章代碼(AID): #1DGKHFPE (RegExp)