Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は現在、ファイルを単語に分割するために以下を使用しています-もっと速い方法はありますか?
while read -r line do for word in $line do words="${words}\n${word}" done done
trを使用するのはどうですか?
tr -s '[:space:]' '\n' < myfile.txt
複数の-s空白文字を1つに絞ります。
-s
xargs -n 1 echo <myfile.txt
sed 's/[[:space:]]/\n/g' file.txt