Depending on the type of processing you need to do on any file, it's possible you meight need to convert it into a list of words, with one word per line.
Code:
# cat test.file
FreeBSD 7.2-RELEASE is now available for the amd64, i386, ia64, pc98, powerpc, and sparc64 architectures.
FreeBSD 7.2 can be installed from bootable ISO images or over the network; the required files can be downloaded via FTP or BitTorrent as described in the sections below. While some of the smaller FTP mirrors may not carry all architectures, they will all generally contain the more common ones, such as i386 and amd64.
Turning
test.file into a list of words with
tr Unix utility is simple:
Code:
# cat test.file | tr ' ' '\n'
FreeBSD
7.2-RELEASE
is
now
available
for
the
amd64,
...
But this does not solve the problem with non-alpha characters.
This is how to transform the text contained in a file into a list of words removing non-alpha charactersCode:
# cat test.file| tr -cs "[:alpha:]" "\n"
FreeBSD
RELEASE
is
now
available
for
the
amd
...
This is how to transform the text contained in a file into a list of words removing only punctuation marksCode:
# cat test.file | tr -d '[:punct:]' | tr ' ' '\n'
FreeBSD
72RELEASE
is
now
available
for
the
amd64
...
Post here your questions/opinions.