Extract words from files

How can I extract all the words from a file, every word on a single line? Example:

test.txt

This is my sample text

Output:

This
is
my
sample
text

Answers


The tr command can do this...

tr [:blank:] '\n' < test.txt

This asks the tr program to replace white space with a new line. The output is stdout, but it could be redirected to another file, result.txt:

tr [:blank:] '\n' < test.txt > result.txt

Need Your Help

Does Passing STL Containers Make A Copy?

c++ c++11

I can't remember whether passing an STL container makes a copy of the container, or just another alias. If I have a couple containers:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.