作者MOONRAKER.bbs@ptt.cc (㊣烏笨禿,又笨又禿) 看板: linux
標題Re: [問題] egrep+awk後,如何在每一列自行加 西元 …
時間批踢踢實業 (2008/05/11 Sun 19:38:18)
: 推 seedbcc:我也知 加2008,問題是..若到2009 我不就要自行再改一次..
那也很簡單
'{YR=strftime("%Y"); printf("%s %s %s %s, %s\n", $3, $2, $1, YR, $11)}'
不然
'{"date +%Y" | getline YR; \
printf("%s %s %s %s, %s\n", $3, $2, $1, YR, $11)}'
awk的書線上很多,自己學一學,很實用。
http://www.math.utah.edu/docs/info/gawk_toc.html
--
Batch 2 update (5/10) - 西班牙宗教審訊 - 主教 - 地獄阿婆 - AND LOTS MORE
Unleashed Pythonesque pleasure, fully l10n'ed for Traditional Chinese
Spam-a-lot and prosper with the Monty Python!
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
■ 蒙帝派松正體中文計畫 ■ http://www.youtube.com/user/JamesBondXD
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.115.217.49