Replace Pioneer Home
All Examples
Free Download
all
Advanced search and replace
Replace text in multiple files
Regular expression replace
Batch file rename
Batch download
Text file parser
Text file splitter
Html text generator
Search replace binary
Random word generator
Count and statistics
Character encoding
Bin Hex Oct Dec converter
Text generator
Text sort
Text merge
Text data calculation
RSS: Replace Pioneer Examples
415.Count and statistics -- How to add a number in each line indicating number of words in this line?
User:
editor -- 2010-02-06
<< 414
416 >>
Hits:
3692
Type:
Count and statistics
Search all
Count and statistics
examples
Description:
How to add a number in each line indicating number of words in this line?
Input Sample:
Character count
Batch download
Advanced search and replace
Batch file rename
Output Sample:
(2) Character count
(2) Batch download
(4) Advanced search and replace
(3) Batch file rename
Answer:
Hint: You need to
Download and install "Replace Pioneer"
on windows platform to finish following steps.
1. ctrl-o open source text file
2. ctrl-h open 'replace' dialog
* set 'Replace Unit' to 'Line'
* set 'Replace with pattern' to:
\(count($match,'\S+')\) $match\n
3. click 'Replace', done
4. ctrl-s save to file
Note: count(string, pattern) return the number of pattern in the string.
Download Script:
scripts/415.rst.zip
Screenshot 1: Replace_Window
Similar Examples:
How to sort the numbers in each line by the descending order in a text file?
(64%)
How to count number of each intial letters in all words in text file?
(62%)
How to change the number in each line to specified order in a text file?
(61%)
How to find out in each line which words in the list appear?
(59%)
How to change each number to an increasing number starting from 8?
(58%)
How to add some number to the specific column in csv file?
(58%)
How to add number at end according to domain name at the begin of line?
(57%)
How to find the maximum number in each line that contains 3 numbers?
(57%)
Check Demo of
Count and statistics
Keywords:
toc
dic
return
statistics
statist
count and statistics
ics
string
count
words
add line return
statistics of number of words
add a return
add return
statistics words in a text
words statistics in text
add words each line
replace string with number