Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

484.Count and statistics -- How to count the occurrance of some specified words in many files?

User: editor -- 2010-04-21          << 483  485 >>
Hits: 502
Type: Count and statistics   
Search all Count and statistics examples
Description:
How to count the occurrance of some specified words in many files?
Input Sample:
some files:

c:\test\file1.txt
c:\test\file2.txt
c:\test\file3.txt
...
Output Sample:
a text file contains following info:

file1.txt word1:80 word2:39
file2.txt word1:66 word2:5
file3.txt word1:123 word2:555
...
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. open 'Tools->Batch Runner' window
2. drag all text files from "Windows File Browser" to "Batch Runner" window
3. check option of "set output filename", change the following entry to "result.txt"
4. check option of "Change output folder", change the following entry to a folder you want to put result.txt
5. click 'Fast Replace' button:
* click "add",enter "search" like: 

* enter "replace" like: 

* Make sure "Regular exp" option and "Cross Line" option are selected.
* Set Write Mode to ">> Append" to join the result to one file.
6. Click 'Start' button, you will get all count of the words into one file -- result.txt

Screenshot 1:  Batch_Runner_Window


Screenshot 2:  Fast_Replace_Window


Similar Examples:
How to count the occurrence of a list of words in a text file? (72%)
How to count the occurrance of specific pattern in each line of text file? (70%)
How to replace the 2nd and 3rd occurrences of some words in multiple files? (65%)
How to count the occurrance of each bytes from 00-FF in a binary file? (65%)
How to add bold tag for some specified keywords in multiple html files? (64%)
How to extract multiple lines in specified order from many text files? (64%)
How to count the appearance of 100 most commonly used words in an article? (63%)
How to convert the text format by user specified rules? (63%)

Check Demo of Count and statistics
Keywords:
occurrance  mode  filename word  append  ppen  statist  statistics  ics  cross line  output folder  count occurrance  join filename  replace words in filename  words statistics in text file  words statistics in text  file into many files  join files  count words