How can I read words (instead of lines) from a file?

前端 未结 7 1845
眼角桃花
眼角桃花 2020-12-16 12:37

I\'ve read this question about how to read n characters from a text file using bash. I would like to know how to read a word at a time from a file that looks like:



        
7条回答
  •  离开以前
    2020-12-16 12:59

    This can be done using AWK too:

    awk '{for(i=1;i<=NF;i++) {print $i}}' text_file

提交回复
热议问题