![]() |
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 14:47 |
47,812 topics / 349,917 posts / today 0 new / 48,273 members |
| DOS批处理 & 脚本技术(批处理室) » Can batch processing achieve sequence numbers? |
| Printable Version 1,862 / 7 |
| Floor1 bush | Posted 2005-11-22 23:46 |
| 银牌会员 Posts 730 Credits 2,165 | |
|
For example, to generate sequences like 1, 2, 3... 999, how to do it?
Requirements: Do not use commands under XP. |
|
| Floor2 220110 | Posted 2005-11-23 07:57 |
| 荣誉版主 Posts 313 Credits 718 | |
|
"Requirement: cannot use commands under XP. " How to understand this? That is, only use DOS's COMMAND?
If that's the case, using WAIT and COUNTER should be possible. Idea: Refer to PLC programming to use "timer and counter relay" to achieve long delay mode, timing drive, counting step activation. But BATCH FILE may have a simpler way. Please discuss everyone:> |
|
| Floor3 JonePeng | Posted 2005-11-23 19:42 |
| 金牌会员 Posts 1,883 Credits 4,562 From 广东广州 | |
|
It can be done with the third - party tool Strings.com.
|
|
| Floor4 willsort | Posted 2005-11-25 21:37 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
Re bush:
Recently, there seem to be many problems that need to be solved under MSDOS/Win9x_COMMAND, which is very similar to my situation three years ago, and I feel like meeting an old acquaintance from afar. Regarding generating sequence numbers, I remember mentioning it in a past reply, but it's hard to find now; if I have time, I will organize it into my " An Unusual Batch Programming" topic, please wait. Now provide a relatively similar code , which uses double loop nesting to generate and process sequence numbers with and without prefix 0 between 0-9 and 10-99. Change the file name to 001.txt 010.txt...100.txt http://www.cn-dos.net/forum/viewthread.php?tid=14512 [ Last edited by willsort on 2005-11-25 at 21:54 ] |
|
| Floor5 bush | Posted 2005-11-26 00:07 |
| 银牌会员 Posts 730 Credits 2,165 | |
|
Thanks willsort, my problem has been solved!
|
|
| Floor6 bush | Posted 2005-11-26 00:12 |
| 银牌会员 Posts 730 Credits 2,165 | |
|
The cause is like this. Got a download package of a website, came back and saw it was incomplete. Had to check to know which files were missing, a thankless task! And these file names are composed of sequence numbers, like this: www.xxx.com/xxx/file1.html、www.xxx.com/xxx/file2.html……www.xxx.com/xxx/file389.html.
Fiddled around for a long time and came up with some batch processing solutions. The idea was to generate sequence numbers first and then use exist to judge. Before starting, for safety, changed.html to.htm a.bat ;Actually the first batch processing file was also generated with batch processing. b.bat c.bat The finally obtained urls.lst is the needed file. Hehe, then batch process to download ~ ![]() [ Last edited by bush on 2005-11-26 at 00:13 ] |
|
| Floor7 无奈何 | Posted 2005-11-26 11:42 |
| 荣誉版主 Posts 356 Credits 1,338 | |
|
It's simple under CMD, just one statement can do it.
For downloading things like this, I usually use curl or wget, and then batch organize, which is very convenient. |
|
| Floor8 willsort | Posted 2005-11-26 17:21 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
—————————————— willsort Moderation Record —————————————— Merge Topic: {17950} Talk about an Example of Solving Problems with Batch Recently (Sequence) — Just Showing Off Merge Reason: The two topics have direct contextual connections —————————————— willsort Moderation Record —————————————— [ Last edited by willsort on 2005-11-26 at 18:16 ] |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |