User: editor -- 2010-04-29 << 491 493 >> |
Hits: 4092 |
Type: Count and statistics |
Search all Count and statistics examples |
Description: |
How to count the number of lines and characters in multiple files and make a list? I have many text files that contains some data, can I count how many lines, how many characters in each file, and make a list for it? |
Input Sample: |
01.txt 02.txt 03.txt .. |
Output Sample: |
result.txt contains following contents: File: 01.txt Lines: 3 Chars: 13 File: 02.txt Lines: 3 Chars: 12 File: 03.txt Lines: 9 Chars: 33 ... |
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', and modify the following entry to: 4. click 'Fast Replace' button,open 'Fast Replace' window * click 'Add' button, in 'Search' entry, enter: * in 'Replace' entry, enter: * click 'ok' * make sure 'Regular Exp' option is checked * change the write_mode from '> Overwrite' to '>> Append' * click 'Start', the result will be attached to result.txt |
Screenshot 1: Fast_Replace_Window |