how to calculate words in a file

N/a / NA
February 10, 2009 at 00:40:43
Specs: Linux, na
I have a directory of CDR files saved on my linux server. I am looking for a way to scan all of them at once, and report statistics on how often words are used. For example: script that would scan all the files and tell me that the wor d"0007" is used 100 times, "21" 200 times, and "11" 12 times. Any ideas how to do this?


See More: how to calculate words in a file

Report •


#1
February 10, 2009 at 15:31:25
Read through the files and parse the words out. Add the words to a dictionary if new and increment count.

Report •

#2
February 11, 2009 at 01:52:21
its not easy to check all words as file contains million of code like
0030057790
0030057791

Report •

#3
February 12, 2009 at 15:12:36
The computer does the 'reading' and 'checking' and 'counting'. All you have to know what delimits (separates) the words and are there special conditions that may surround the words (quotation marks, bol, eof, bof, eof markers). Words can be either numeric, alphabetic, or a combination of those. If you have millions of items then be prepared for possibly millions of pages of output. Maybe you really are only interested in a subset of the items.
I once did a program to count the occurences of words in a book.

Report •

Related Solutions


Ask Question