Re: Word Count for 100 Files?

Subject: Re: Word Count for 100 Files?
From: Eric Ray <ejray -at- raycomm -dot- com>
To: "TECHWR-L" <techwr-l -at- lists -dot- raycomm -dot- com>
Date: Wed, 03 Dec 2003 05:24:57 -0700




Richard Burkhart wrote:

Assuming:
- You had UNIX/Linux experience
- You have access to a UNIX/Linux machine (or Cygwin in Windows)
- You knew a bit about BASH script programming (I'm trying to remember the
specifics from a class from 6 months ago)
- Your documents were plaintext, instead of a document (w) formatting
codes

Actually, if you can get the docs into HTML, you can do this too. See below.


The BASH command "wc" (word count) might be a way to go. You'd need to:
- set up a small script/extended statement to list the file names
- open each file

If you're dealing with HTML, use
lynx -dump filename.html
to get plain (countable) text.


- pipe the file through WC
- dump the number of words (with identifier text) into another text file.

Gimme a little bit of time to review and I can post specifics -- if this is
an avenue that you'd pursue.



Minimally, it could be as simple as:

#!/bin/bash
for i in `ls *.html`
do
echo $i
lynx -dump $i | wc
done

to look at all HTML files, convert them to text, count the
characters/words/lines, and print the name and the counts
for each file to the screen.

Eric




^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

ROBOHELP FOR FRAMEMAKER TRIAL NOW AVAILABLE!

RoboHelp for FrameMaker is a NEW online publishing tool for FrameMaker that
lets you easily single-source content to online Help, intranet, and Web. The interface is designed for FrameMaker users, so there is little or no
learning curve and no macro language required! Call 800-718-4407 for competitive pricing or download a trial at: http://www.ehelp.com/techwr-l4

---
You are currently subscribed to techwr-l as:
archive -at- raycomm -dot- com
To unsubscribe send a blank email to leave-techwr-l-obscured -at- lists -dot- raycomm -dot- com
Send administrative questions to ejray -at- raycomm -dot- com -dot- Visit
http://www.raycomm.com/techwhirl/ for more resources and info.



References:
RE: Word Count for 100 Files?: From: Richard Burkhart

Previous by Author: Re: Documenting unix utilites
Next by Author: Seeking reviews
Previous by Thread: Re: Word Count for 100 Files?
Next by Thread: Word Count for 100 Files?


What this post helpful? Share it with friends and colleagues:


Sponsored Ads