中国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-09-23 22:09
47,812 topics / 349,917 posts / today 0 new / 48,274 members
DOS批处理 & 脚本技术(批处理室) » [Wonderful] [Statistics of the Number of Occurrences of Batch Processing Characters]
Printable Version  24,516 / 41
Floor16 namejm Posted 2006-11-30 02:49
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Everyone's code is very wonderful. Compared with my sort scheme, it is much more sophisticated. I will give you all points!
Floor17 namejm Posted 2006-11-30 02:53
荣誉版主 Posts 1,737 Credits 5,226 From 成都
The plan I made is here
Floor18 zh159 Posted 2006-11-30 02:58
金牌会员 Posts 1,467 Credits 3,687
Redtek's use of shift shifting and the sequential display feature of set .

Increase the display of the most frequent occurrence ^_^



Bug fixed

[ Last edited by zxcv on 2006-11-29 at 08:27 PM ]
Floor19 redtek Posted 2006-11-30 03:14
金牌会员 Posts 1,147 Credits 2,902
Brother namejm on floor 17's plan "Make a batch script for content statistics in text" is being appreciated. The code inside is really interesting and wonderful ~~ : ) ) )

In response to Brother zxcv: The reason the code on my floor 15 didn't include the part for the most frequent occurrence is because I didn't know how to do it (whispering ~)

Really wonderful ~~ Learned from Brothers namejm and zxcv ~ : ) ) )
Floor20 zh159 Posted 2006-11-30 03:18
金牌会员 Posts 1,467 Credits 3,687
I'm learning on the fly
All are good examples of learning good role models
Floor21 pengfei Posted 2006-11-30 03:33
银牌会员 Posts 485 Credits 1,218 From 湖南.娄底
Great, everyone keep it up^_^
Floor22 redtek Posted 2006-11-30 03:48
金牌会员 Posts 1,147 Credits 2,902
if !.%1! GTR !maxN! set maxN=!.%1! && set max=.%1
if %%j GTR !l! set l=%%j & set m=%%i

The sentence from user namejm and zxcv is interesting~~

Find the largest number. If the value obtained is greater than the "variable storing the maximum value", it means the obtained number is larger, so it should replace the original value in the "variable storing the maximum value". After all the data has been "gone through", the value in the "variable storing the maximum value" will naturally be the largest value~:)

Appreciate and strongly support!!!
Learned a lot more, and communication has sparked many inspirations~
Floor23 lxmxn Posted 2006-11-30 04:13
版主 Posts 4,938 Credits 11,386

  Just tested the code on floor 18. Based on the code on floor 18, I increased the value of the str variable and set it to: set str=adadfdfseffserfefsefseetsdgdsfjkljdsklfjdsfdsgdsafdsaf, then ran the batch file, and the result was:

.a=4
.d=10
.e=6
.f=9
.g=2
.j=3
.k=2
.l=2
.r=1
.s=11
.t=1
The most frequent occurrence: .f=9
Press any key to continue. . .
Floor24 无奈何 Posted 2006-11-30 04:31
荣誉版主 Posts 356 Credits 1,338
The latter ones are getting more and more exciting. Everyone gains a lot from such exchanges, learns quickly and it's also interesting.
It is suggested that everyone find more such problems in the future. The requirements should not be too difficult, focusing on participation.
Let's discuss whether we can add some honorary awards in each session in the future, such as:
Shortest code
Fastest speed
Strongest stability
Best creativity
And another type that no one can understand but can complete the function.
Give full play to everyone's divergent thinking from these perspectives. However, how to name such things...
Floor25 vkill Posted 2006-11-30 04:49
金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽
There is another kind that no one can understand clearly but can complete the function. Hehe, this non-willing to be helpless moderator, you did magic.
Floor26 redtek Posted 2006-11-30 05:08
金牌会员 Posts 1,147 Credits 2,902
Then the moderator's name is "Unprecedented"~ Isn't this name great?
Floor27 tao0610 Posted 2006-11-30 05:20
高级用户 Posts 218 Credits 579
The results with the most occurrences of MS are not quite right. Where is the problem?
Floor28 youxi01 Posted 2006-11-30 05:23
高级用户 Posts 247 Credits 846 From 湖南==》广东
Also post an immature piece of code to count the number of occurrences of each character:

Idea: First use the "function" test to get the length of variable str and save it as OSlen; then get the first character of variable str and save it as str0, then replace all str0 in variable str with empty, then get the length of str and save it as %num%, then the first character that appears is: %str0%, and the length is: %OSlen%-%num%, and so on.....



[ Last edited by youxi01 on 2006-11-30 at 06:47 AM ]
Floor29 tao0610 Posted 2006-11-30 05:29
高级用户 Posts 218 Credits 579
I also post one using for /l!
Floor30 youxi01 Posted 2006-11-30 06:10
高级用户 Posts 247 Credits 846 From 湖南==》广东
Appreciate the code on floors 15 and 18, learned it! Made a little change to the above code, but the essence remains!
Prev  1 2 3  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023