Printing the last column of a line in a file

前端 未结 11 1499
遇见更好的自我
遇见更好的自我 2020-12-12 11:33

I have a file that is constantly being written to/updated. I want to find the last line containing a particular word, then print the last column of that line.

The fi

11条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-12 12:31

    Execute this on the file:

    awk 'ORS=NR%3?" ":"\n"' filename
    

    and you'll get what you're looking for.

提交回复
热议问题