Word counting

  • Follow


Hello.

I am looking for an editor or word processor that will load a text file 
and break it down into single word usage of how many times a word is 
used in a document? There are lots that do a word count of sorts, but I 
have not found any that count occurrences of individual words. I know I 
am either looking for the wrong program type, or using the wrong words 
to search on. Thanks in advance.

0
Reply boscopelone (33) 10/9/2007 11:54:51 AM

In article <2007100905550811272-boscopelone@yahoocom>, bosco
<boscopelone@yahoo.com> wrote:

> Hello.
> 
> I am looking for an editor or word processor that will load a text file 
> and break it down into single word usage of how many times a word is 
> used in a document? There are lots that do a word count of sorts, but I 
> have not found any that count occurrences of individual words. I know I 
> am either looking for the wrong program type, or using the wrong words 
> to search on. Thanks in advance.
> 

http://www.supermagnus.com/mac/Word_Counter/

-- 
Help improve usenet. Kill-file Google Groups.
http://improve-usenet.org/
0
Reply Dave 10/9/2007 1:13:25 PM


In article <2007100905550811272-boscopelone@yahoocom>,
 bosco <boscopelone@yahoo.com> wrote:

> Hello.
> 
> I am looking for an editor or word processor that will load a text file 
> and break it down into single word usage of how many times a word is 
> used in a document? There are lots that do a word count of sorts, but I 
> have not found any that count occurrences of individual words. I know I 
> am either looking for the wrong program type, or using the wrong words 
> to search on. Thanks in advance.

If you know a little perl or other scripting language, it would be 
fairly easy to write such a problem, but try looking on
http://www.versiontracker.com to see what turns up.
0
Reply Shawn 10/9/2007 2:03:22 PM

In article <2007100905550811272-boscopelone@yahoocom>,
 bosco <boscopelone@yahoo.com> wrote:

> I am looking for an editor or word processor that will load a text file 
> and break it down into single word usage of how many times a word is 
> used in a document? There are lots that do a word count of sorts, but I 
> have not found any that count occurrences of individual words. I know I 
> am either looking for the wrong program type, or using the wrong words 
> to search on. Thanks in advance.

I'll leave it as an exercise to the reader to create an Automator action 
or some other non-Terminal solution, but a simple pipe that will 
accomplish this is:

sed s/' '/'\
'/g | sort | uniq -c | sort -r

You can strip out punctuation and case if you want to get fancy.  No 
special program is required.

-- 
My personal UDP list: 127.0.0.1, 4ax.com, buzzardnews.com, googlegroups.com,
    heapnode.com, localhost, teranews.com, x-privat.org
0
Reply Doc 10/9/2007 3:36:03 PM

In <srhi-50D15A.10032209102007@newsgroups.comcast.net>, Shawn Hirn wrote:

> If you know a little perl or other scripting language, it would be
> fairly easy to write such a problem,

When I taught intro Unix courses a long long time ago I actually used this 
example of what you could do by stringing together a bunch of appearently 
useless little filters in a pipe line.

# tr -cs 'A-Za-z' '\012' < file | sort | uniq -c | sort -nr | head -20

to see the twenty most frequent words in text file "file"

Of course it doesn't work well with words with apostrophes, but it does 
get the point.  If you want to see more output in nice columns then 
try something like

# tr -cs 'A-Za-z' '\012' < file | sort | uniq -c | sort -nr | \
    head -60 | pr -3 -t

Cheers,

-j

-- 
Jeffrey Goldberg                     http://www.goldmark.org/jeff/
  I rarely read top-posted, over-quoting or HTML postings.
  http://improve-usenet.org/
0
Reply Jeffrey 10/9/2007 3:46:39 PM

In article <2007100905550811272-boscopelone@yahoocom>,
 bosco <boscopelone@yahoo.com> wrote:

> Hello.
> 
> I am looking for an editor or word processor that will load a text file 
> and break it down into single word usage of how many times a word is 
> used in a document? There are lots that do a word count of sorts, but I 
> have not found any that count occurrences of individual words. I know I 
> am either looking for the wrong program type, or using the wrong words 
> to search on. Thanks in advance.

cat [file] | grep -c [word]
-- 
W. Oates
0
Reply Warren 10/9/2007 4:47:50 PM

In article <470bb099$0$24120$c3e8da3@news.astraweb.com>,
 Warren Oates <warren.oates@gmail.com> wrote:

> In article <2007100905550811272-boscopelone@yahoocom>,
>  bosco <boscopelone@yahoo.com> wrote:
> 
> > Hello.
> > 
> > I am looking for an editor or word processor that will load a text file 
> > and break it down into single word usage of how many times a word is 
> > used in a document? There are lots that do a word count of sorts, but I 
> > have not found any that count occurrences of individual words. I know I 
> > am either looking for the wrong program type, or using the wrong words 
> > to search on. Thanks in advance.
> 
> cat [file] | grep -c [word]

In addition to all other suggestions, perhaps this low tech 
solution will do you: in the free TextWrangler editor. Find 
(Command F with the doc open), type in the word concerned and 
press Find All. At the top of the list in the window that comes 
up is a summary count (as well as a list underneath of all the 
instances)

-- 
dorayme
0
Reply dorayme 10/9/2007 10:16:38 PM

On 2007-10-09 15:16:38 -0700, dorayme <doraymeRidThis@optusnet.com.au> said:

> In article <470bb099$0$24120$c3e8da3@news.astraweb.com>,
>  Warren Oates <warren.oates@gmail.com> wrote:
> 
>> In article <2007100905550811272-boscopelone@yahoocom>,
>> bosco <boscopelone@yahoo.com> wrote:
>> 
>>> Hello.
>>> 
>>> I am looking for an editor or word processor that will load a text file
>>> and break it down into single word usage of how many times a word is
>>> used in a document? There are lots that do a word count of sorts, but I
>>> have not found any that count occurrences of individual words. I know I
>>> am either looking for the wrong program type, or using the wrong words
>>> to search on. Thanks in advance.
>> 
>> cat [file] | grep -c [word]
> 
> In addition to all other suggestions, perhaps this low tech
> solution will do you: in the free TextWrangler editor. Find
> (Command F with the doc open), type in the word concerned and
> press Find All. At the top of the list in the window that comes
> up is a summary count (as well as a list underneath of all the
> instances)

That does give a word count (subject title), but doesn't won't "break 
it down into single word usage of how many times...".

Incidentally DevonThink does all this stuff.
-- 
Thank you and have a nice day.

0
Reply gtr 10/9/2007 11:54:46 PM

In article <200710091654468930-xxx@yyyzzz>, gtr <xxx@yyy.zzz> 
wrote:

> On 2007-10-09 15:16:38 -0700, dorayme <doraymeRidThis@optusnet.com.au> said:
> 
> > In article <470bb099$0$24120$c3e8da3@news.astraweb.com>,
> >  Warren Oates <warren.oates@gmail.com> wrote:
> > 
> >> In article <2007100905550811272-boscopelone@yahoocom>,
> >> bosco <boscopelone@yahoo.com> wrote:
> >> 
> >>> Hello.
> >>> 
> >>> I am looking for an editor or word processor that will load a text file
> >>> and break it down into single word usage of how many times a word is
> >>> used in a document? There are lots that do a word count of sorts, but I
> >>> have not found any that count occurrences of individual words. I know I
> >>> am either looking for the wrong program type, or using the wrong words
> >>> to search on. Thanks in advance.
> >> 
> >> cat [file] | grep -c [word]
> > 
> > In addition to all other suggestions, perhaps this low tech
> > solution will do you: in the free TextWrangler editor. Find
> > (Command F with the doc open), type in the word concerned and
> > press Find All. At the top of the list in the window that comes
> > up is a summary count (as well as a list underneath of all the
> > instances)
> 
> That does give a word count (subject title), but doesn't won't "break 
> it down into single word usage of how many times...".
> 
> Incidentally DevonThink does all this stuff.

The op's q was about how to analyse more than a particular word? 
Fair enough.

(Just btw, I vaguely remember making a QuickBasic program once to 
see the frequency of individual letters in a piece of txt... It 
is on one of my SE30s... I think...)

-- 
dorayme
0
Reply dorayme 10/10/2007 12:06:22 AM

8 Replies
82 Views

(page loaded in 0.101 seconds)


Reply: