中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-25 23:27
47,812 topics / 349,910 posts / today 0 new / 48,264 members
DOS批处理 & 脚本技术(批处理室) » Batch processing (merging, statistics) of a large number of text files
Printable Version  2,948 / 5
Floor1 oxus Posted 2006-10-04 23:36
新手上路 Posts 1 Credits 6
I have a series of text files (596 files) and want to do the following processing:
1. Merge the contents of specified files (such as 001 to 180), preferably according to input like "Please enter the files you want to merge", and write to a new file new001.txt;
2. Count the frequency of all Chinese characters (preferably including punctuation marks) in new001, and write the result to result001.txt.
I'm a novice, please trouble experts to give some guidance.
Floor2 electronixtar Posted 2006-10-04 23:58
铂金会员 Posts 2,672 Credits 7,493
One thing that is quite annoying is: Is it a bit of a waste to use batch processing for many one-time, non-repeating tasks?

Personally, I think the user's problem can be well solved with Word. Do you really have to handle it in the cmd black box to feel comfortable?
Floor3 NaturalJ0 Posted 2006-10-05 00:12
银牌会员 Posts 533 Credits 1,181
The frequency of all Chinese characters appearing = =b
I want to know, what's the use of you doing this statistics.
Floor4 pengfei Posted 2006-10-05 00:25
银牌会员 Posts 485 Credits 1,218 From 湖南.娄底
It's not impossible to meet the LZ's requirements. But if you want to filter so many characters, you can imagine how inefficient it will be. The code will also be very long and tedious~~~!
Floor5 namejm Posted 2006-10-05 00:27
荣誉版主 Posts 1,737 Credits 5,226 From 成都
For your first question, the following code can be used to implement it:

Hitme once did the statistics on the frequency of Chinese character occurrence, but it seems that the result is not very accurate. Here is his code for everyone to discuss
Floor6 redtek Posted 2006-10-05 10:34
金牌会员 Posts 1,147 Credits 2,902
Originally posted by oxus at 2006-10-4 23:36:
I have a series of text files (596 files), and I want to do the following processing:
1. Merge the content of specified files (such as from 001 to 180). It is best according to input, for example "Please enter the files you want to merge...



What do you want:

A、Help you complete the work tasks you encounter? (Do it all for you)
B、Help you master the knowledge needed to complete the work? (Help you master batch processing knowledge, and you learn to do it yourself)
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023