Linuxawk 處理文本 - LinuxBarb Cronin · 2018-07-08Table of ContentsPostCommentsRelated Posts想請問一下如果手邊有一份資料如下 A B C D 5 R F E 9 是否有可能靠 awk來把文本處理成 5 A 5 B 5 C 5 D 9 R 9 F 9 E 可以請版友可以給我一點小提示嗎? 謝謝 -- LinuxAll CommentsAnnie2018-07-09他算欄位從 1 開始; NF 代表這行有幾欄; 有 for 迴圈能用Noah2018-07-11題示 awk '{for(i=1;i<=NF;i++){print NF}}' 自行改Kyle2018-07-15cat file |awk '{for(i=1;i<=NF-1;i++) {print $NF$i}}'Anonymous2018-07-18i <NF 就好,不用 <= 又 -1...Todd Johnson2018-07-22cat file | awk '{for(i=1;i<NF;i++){print $NF" "$i}}'Yuri2018-07-23↑↑幫修…XDCandice2018-07-27其實也不用多呼叫一次 cat, awk ‘{}’ filename 就可以了Related Posts請問各發行版的 repo 都會自動更新嗎?root群組的使用者不能使用useradd嗎?Modify bashrc新新手合適的VNC(Win<<---->>Linux)Virtualbox Ubuntu 共享資料夾無法掛載
All Comments