中国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-09 10:29
47,811 topics / 349,895 posts / today 0 new / 48,253 members
DOS批处理 & 脚本技术(批处理室) » Create folders in batches based on filenames, and put the files into them
Printable Version  733 / 5
Floor1 78079144 Posted 2008-08-07 10:15
新手上路 Posts 3 Credits 8
There are several hundred files in one directory. Their filenames are similar, all like “20080102-XXX”, etc. Now I want to create corresponding subfolders in a format like “20080102”, etc., and put all files beginning with 20080102 into the matching folder. What should I do?
For example, if the folder contains the file: 20080103-Zhang Sanfeng-file
then create the subfolder 20080103, and put the above file into it
Similarly, put 20080506-Sun Xiaoyi-report materials into 20080506

Please don't hesitate to advise, thanks!
Floor2 huahua0919 Posted 2008-08-07 13:07
银牌会员 Posts 780 Credits 1,608
Floor3 78079144 Posted 2008-08-09 10:24
新手上路 Posts 3 Credits 8
Originally posted by huahua0919 at 2008-8-7 01:07 PM:



Using the above command I can get the “20080506” folder, but what I want is the “20080506-Sun Xiaoyi” folder
Floor4 huahua0919 Posted 2008-08-09 10:37
银牌会员 Posts 780 Credits 1,608

Wasn't that what you yourself said?
Floor5 huahua0919 Posted 2008-08-09 10:42
银牌会员 Posts 780 Credits 1,608
Floor6 78079144 Posted 2008-08-09 11:07
新手上路 Posts 3 Credits 8
Oh, thanks, I said it wrong
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023