|
lotus516
高级用户
    论坛上抢劫的
积分 551
发帖 246
注册 2006-9-21
状态 离线
|
『楼 主』:
dir求助
我dir一个文件夹,可得到的文件排列如下:
第10章.txt
第11章.txt
第12章.txt
第13章.txt
第14章.txt
第15章.txt
第16章.txt
第17章.txt
第18章.txt
第19章.txt
第1章.txt
第20章.txt
第21章.txt
第22章.txt
第23章.txt
第24章.txt
第25章.txt
第26章.txt
第27章.txt
第28章.txt
第29章.txt
第2章.txt
第3章.txt
第4章.txt
第5章.txt
第6章.txt
第7章.txt
第8章.txt
第9章.txt
我想得到如下的排列,请问参数是什么?
第1章.txt
第2章.txt
第3章.txt
第4章.txt
第5章.txt
第6章.txt
第7章.txt
第8章.txt
第9章.txt
第10章.txt
第11章.txt
第12章.txt
第13章.txt
第14章.txt
第15章.txt
第16章.txt
第17章.txt
第18章.txt
第19章.txt
第20章.txt
第21章.txt
第22章.txt
第23章.txt
第24章.txt
第25章.txt
第26章.txt
第27章.txt
第28章.txt
第29章.txt
|
|
2006-12-2 14:48 |
|
|
lbccyxs
初级用户
 
积分 54
发帖 27
注册 2006-12-2
状态 离线
|
『第
2 楼』:
好象不可以。
第1章.txt 改为 第01章.txt
就可以了
|
|
2006-12-2 15:03 |
|
|
namejm
荣誉版主
       batch fan
积分 5226
发帖 1737
注册 2006-3-10 来自 成都
状态 离线
|
『第
3 楼』:
你是需要把 第×章 ×换成两位数,不足两位的在前面补0,然后升序排列它们是吗?看了你两层楼的描述,仍然不太敢确定你究竟想要实现什么目的,请把你的意思表达清楚。
另外,这个 × 是不是只有阿拉伯数字格式?请把完整的需求说一下,这样才好写代码。
|

尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。 |
|
2006-12-2 20:12 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
|
2006-12-2 21:31 |
|
|
lotus516
高级用户
    论坛上抢劫的
积分 551
发帖 246
注册 2006-9-21
状态 离线
|
『第
5 楼』:
我的语言真的差?第二次别人不能理解我的意思了!!!!!!!汗!!!!!!!
我是说原文件名就是从第1章-第29章的,而我并不把原文件名改掉,DIR一个文件夹>1.txt,得到的TXT文本要从小到大的排列,不要向上面的第一个排列那样从10-19在排1,接着20-29再排2,再3-9!!我目的是得到从1-9在10-19,再20-29这样的排列!!!因为用批不好生成其它的可以升序的文件(还是能力不足?),故只考虑阿拉伯数字格式!!还有一点我如用批生成这样以01-20命名的文件,FOR语句应如何写,从文本读取变量的方法不考虑!!
|
|
2006-12-3 03:49 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
|
2006-12-3 04:07 |
|
|
redtek
金牌会员
     
积分 2902
发帖 1147
注册 2006-9-21
状态 离线
|
  『第
7 楼』:
dir /b 第?章.txt > List.txt && dir /b 第??章.txt >> List.txt 得到的文件列表存到 List.txt 文件内:
第1章.txt
第2章.txt
第3章.txt
第4章.txt
第5章.txt
第6章.txt
第7章.txt
第8章.txt
第9章.txt
第10章.txt
第11章.txt
第12章.txt
第13章.txt
第14章.txt
第15章.txt
第16章.txt
第17章.txt
第18章.txt
第19章.txt
第20章.txt
第21章.txt
第22章.txt
第23章.txt
第24章.txt
第25章.txt
第26章.txt
第27章.txt
第28章.txt
第29章.txt
此帖被 +9 点积分 点击查看详情 评分人:【 youxi01 】 | 分数: +4 | 时间:2006-12-3 05:04 | 评分人:【 ccwan 】 | 分数: +5 | 时间:2006-12-3 21:06 |
|
|

Redtek,一个永远在网上流浪的人……
_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._ |
|
2006-12-3 04:22 |
|
|
Michael
钻石会员
       
积分 10046
发帖 3039
注册 2002-11-11
状态 离线
|
『第
8 楼』:
复杂问题简单化---聪明人之举!
|

简单就是美 |
|
2006-12-3 13:39 |
|
|
ccwan
金牌会员
     
积分 2725
发帖 1160
注册 2006-9-23 来自 河北廊坊
状态 离线
|
『第
9 楼』:
欣赏……
|

三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。 |
|
2006-12-3 21:07 |
|