[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
回复 19# cobat


    100%正确,分别移动1000首歌不到2秒,目前未发现问题,

这音量字符条件足够多了,这所谓"找不到音量字符"是针对音量更低的值如
,14.
,15.
,16.
,17.
类推,这些,13.外的值,还未有见过,有也没有利用价值,因为音量太低了,故把它们丢入x文件夹


你的代码执行效率很高,赞,再次感谢!

TOP

回复 18# hepeisheng


    可以了,最好把"找不到音量字符"举几个例子

TOP

回复 16# cobat


    我发现你是正确的,是我给的条件错了,现改为如下,主要是进18文件夹由双或选变为单选,18文件夹后的文件夹号都大了1个数值


原部分

如果这首mp3音量为,.就把文件夹里的这首mp3移动进名为18的文件夹
如果这首mp3音量为,1.就把文件夹里的这首mp3移动进名为18的文件夹

如果这首mp3音量为,2.就把文件夹里的这首mp3移动进名为19的文件夹
如果这首mp3音量为,3.就把文件夹里的这首mp3移动进名为20的文件夹
如果这首mp3音量为,4.就把文件夹里的这首mp3移动进名为21的文件夹
如果这首mp3音量为,5.就把文件夹里的这首mp3移动进名为22的文件夹
如果这首mp3音量为,6.就把文件夹里的这首mp3移动进名为23的文件夹
如果这首mp3音量为,7.就把文件夹里的这首mp3移动进名为24的文件夹
如果这首mp3音量为,8.就把文件夹里的这首mp3移动进名为25的文件夹
如果这首mp3音量为,9.就把文件夹里的这首mp3移动进名为26的文件夹
如果这首mp3音量为,10.就把文件夹里的这首mp3移动进名为27的文件夹
如果这首mp3音量为,11.就把文件夹里的这首mp3移动进名为28的文件夹
如果这首mp3音量为,12.就把文件夹里的这首mp3移动进名为29的文件夹
如果这首mp3音量为,13.就把文件夹里的这首mp3移动进名为30的文件夹



修改为

如果这首mp3音量为,.就把文件夹里的这首mp3移动进名为18的文件夹

如果这首mp3音量为,1.就把文件夹里的这首mp3移动进名为19的文件夹
如果这首mp3音量为,2.就把文件夹里的这首mp3移动进名为20的文件夹
如果这首mp3音量为,3.就把文件夹里的这首mp3移动进名为21的文件夹
如果这首mp3音量为,4.就把文件夹里的这首mp3移动进名为22的文件夹
如果这首mp3音量为,5.就把文件夹里的这首mp3移动进名为23的文件夹
如果这首mp3音量为,6.就把文件夹里的这首mp3移动进名为24的文件夹
如果这首mp3音量为,7.就把文件夹里的这首mp3移动进名为25的文件夹
如果这首mp3音量为,8.就把文件夹里的这首mp3移动进名为26的文件夹
如果这首mp3音量为,9.就把文件夹里的这首mp3移动进名为27的文件夹
如果这首mp3音量为,10.就把文件夹里的这首mp3移动进名为28的文件夹
如果这首mp3音量为,11.就把文件夹里的这首mp3移动进名为29的文件夹
如果这首mp3音量为,12.就把文件夹里的这首mp3移动进名为30的文件夹
如果这首mp3音量为,13.就把文件夹里的这首mp3移动进名为31的文件夹




很期待,眼看要完美了,谢谢,以前要选1小时现只要2秒,效率提高1800倍

TOP

回复 14# cobat




    我发现你对的,我给的条件错了,要时间改改

TOP

本帖最后由 hepeisheng 于 2015-3-10 23:18 编辑
回复  hepeisheng


   又改了,你再试试.
cobat 发表于 2015-3-10 21:49



代码执行很快,2秒移动完1000首歌很是喜欢,


我发现你对的,我给的条件错了,要时间改改

TOP

回复 12# hepeisheng


   又改了,你再试试.

TOP

8楼 xxpinqz 同学提供的代码未能移动同样感谢!

TOP

二楼代码执行飞快有效,现有如下问题,如下音量文件都跑到x文件夹了,正确的应该音量为,-.要进17文件夹;音量为,.要进18文件夹

"D:\My music\x\","ANNA_周启生.mp3",#2015-03-10 17:50:03#,4342315,31921.799,-.38,"?"
"D:\My music\x\","阿郎恋曲_许冠杰.mp3",#2015-03-10 17:50:34#,5756572,25913.721,.63,"?"
"D:\My music\x\","春风秋雨_张学友.mp3",#2015-03-10 17:54:01#,4594551,31540.445,-.79,"?"
"D:\My music\x\","道道道_张学友.mp3",#2015-03-10 17:54:50#,3185531,30298.964,-.57,"?"
"D:\My music\x\","等玉人_许冠杰.mp3",#2015-03-10 17:55:01#,2691003,24487.854,-.96,"?"
"D:\My music\x\","风中赶路人_许冠杰.mp3",#2015-03-10 17:56:21#,3774982,34332.508,-.77,"?"
"D:\My music\x\","欢场_张学友.mp3",#2015-03-10 17:58:34#,4502997,31943.557,-.73,"?"
"D:\My music\x\","家乡_韩红.mp3",#2015-03-10 17:59:15#,4174859,32212.451,-.94,"?"
"D:\My music\x\","街头霸王榜_林子祥.mp3",#2015-03-10 17:59:32#,14383201,27996.75,.44,"?"
"D:\My music\x\","金瓶似的小山_腾格尔.mp3",#2015-03-10 17:59:43#,3760804,32982.041,.03,"?"
"D:\My music\x\","浪子心声_许冠杰.mp3",#2015-03-10 18:00:38#,3055109,29308.846,-.97,"?"
"D:\My music\x\","自制空间_林忆莲.mp3",#2015-03-10 18:08:45#,4351496,23902.88,-.35,"?"
"D:\My music\x\","最佳男主角_林忆莲.mp3",#2015-03-10 18:08:49#,3876373,28023.095,-.05,"?"

另有2个名字有!号不移动

"D:\My music\","Cry!_张学友.mp3",#2015-03-10 17:50:07#,5103882,35697.492,-8.28,"?"
"D:\My music\","OH!夜_黎明.mp3",#2015-03-10 17:50:23#,4384084,38135.759,-6.54,"?"

TOP

回复 7# hepeisheng
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. for /f "tokens=2 delims=," %%a in ('findstr /r /c:",-.," "信息.txt"') do move %%a "17\"
  4. for /f "tokens=2 delims=," %%b in ('findstr /r /c:",.," "信息.txt"') do move %%b "18\"
  5. for /f "tokens=2 delims=," %%c in ('findstr /r /c:",," "信息.txt"') do move %%c "x\"
  6. for %%a in (*.mp3) do (
  7. findstr /r /c:"%%~na" "信息.txt" || move "%%a" "x\"
  8. for /f "tokens=2* delims=#" %%d in ('findstr /r /c:"%%~na" "信息.txt"') do (
  9. for /f "tokens=3 delims=," %%i in ("%%e") do (
  10. set "str=%%i"
  11. if "!str:~,2!" == "-." move "%%a" "17\"
  12. if "!str:~,1!" == "." move "%%a" "18\"
  13. for /f "tokens=1* delims=." %%j in ("!str!") do (
  14. if %%j == -16 move "%%a" "01\"
  15. if %%j == -15 move "%%a" "02\"
  16. if %%j == -14 move "%%a" "03\"
  17. if %%j == -13 move "%%a" "04\"
  18. if %%j == -12 move "%%a" "05\"
  19. if %%j == -11 move "%%a" "06\"
  20. if %%j == -10 move "%%a" "07\"
  21. if %%j == -9 move "%%a" "08\"
  22. if %%j == -8 move "%%a" "09\"
  23. if %%j == -7 move "%%a" "10\"
  24. if %%j == -6 move "%%a" "11\"
  25. if %%j == -5 move "%%a" "12\"
  26. if %%j == -4 move "%%a" "13\"
  27. if %%j == -3 move "%%a" "14\"
  28. if %%j == -2 move "%%a" "15\"
  29. if %%j == -1 move "%%a" "16\"
  30. if %%j == 0 move "%%a" "17\"
  31. if %%j == 1 move "%%a" "18\"
  32. if %%j == 2 move "%%a" "19\"
  33. if %%j == 3 move "%%a" "20\"
  34. if %%j == 4 move "%%a" "21\"
  35. if %%j == 5 move "%%a" "21\"
  36. if %%j == 6 move "%%a" "23\"
  37. if %%j == 7 move "%%a" "24\"
  38. if %%j == 8 move "%%a" "25\"
  39. if %%j == 9 move "%%a" "26\"
  40. if %%j == 10 move "%%a" "27\"
  41. if %%j == 11 move "%%a" "28\"
  42. if %%j == 12 move "%%a" "29\"
  43. if %%j == 13 move "%%a" "30\"
  44. )
  45. )
  46. )
  47. )
  48. pause
复制代码

TOP

本帖最后由 xxpinqz 于 2015-3-11 12:34 编辑
  1. @echo off
  2. for /f tokens^=3^,4^delims^=^" %%a in (a.txt) do (
  3.     set "str=%%a"
  4.     setlocal enabledelayedexpansion
  5.     for /f "tokens=4 delims=," %%c in ("%%b") do (
  6.         if not "%%c"=="." (
  7.          if not "%%c"=="-." (
  8.                       set/a n=17+%%c
  9.                       if !n! equ 17 if %%c neq 0 set n=x
  10.                 ) else set n=17
  11.         ) else set n=18
  12.         move "!str!" "!n!\"&endlocal
  13.     )
  14. )2>nul
复制代码
初学BAT,非专业。代码不适当之处还望前辈们多多指点。在此表示感谢!

TOP

发现如果mp3文件的名字有逗号就不移动,

和音量为,-.与,.就不移动,

如下列表是未能移动的,请帮忙解决,谢谢!


"D:\My music\","变,变,变_陈慧娴.mp3",#2015-03-10 17:52:15#,3715976,46701.412,-8.95,"?"
"D:\My music\","缘了,就是完_陈慧娴.mp3",#2015-03-10 18:08:10#,5216660,36685.873,-5.11,"?"
"D:\My music\","多一分钟,少一分钟_周华健.mp3",#2015-03-10 17:55:53#,4111354,36102.144,-5.63,"?"

"D:\My music\","ANNA_周启生.mp3",#2015-03-10 17:50:03#,4342315,31921.799,-.38,"?"
"D:\My music\","阿郎恋曲_许冠杰.mp3",#2015-03-10 17:50:34#,5756572,25913.721,.63,"?"
"D:\My music\","春风秋雨_张学友.mp3",#2015-03-10 17:54:01#,4594551,31540.445,-.79,"?"
"D:\My music\","道道道_张学友.mp3",#2015-03-10 17:54:50#,3185531,30298.964,-.57,"?"
"D:\My music\","等玉人_许冠杰.mp3",#2015-03-10 17:55:01#,2691003,24487.854,-.96,"?"
"D:\My music\","风中赶路人_许冠杰.mp3",#2015-03-10 17:56:21#,3774982,34332.508,-.77,"?"
"D:\My music\","欢场_张学友.mp3",#2015-03-10 17:58:34#,4502997,31943.557,-.73,"?"
"D:\My music\","家乡_韩红.mp3",#2015-03-10 17:59:15#,4174859,32212.451,-.94,"?"
"D:\My music\","街头霸王榜_林子祥.mp3",#2015-03-10 17:59:32#,14383201,27996.75,.44,"?"
"D:\My music\","金瓶似的小山_腾格尔.mp3",#2015-03-10 17:59:43#,3760804,32982.041,.03,"?"
"D:\My music\","浪子心声_许冠杰.mp3",#2015-03-10 18:00:38#,3055109,29308.846,-.97,"?"
"D:\My music\","自制空间_林忆莲.mp3",#2015-03-10 18:08:45#,4351496,23902.88,-.35,"?"
"D:\My music\","最佳男主角_林忆莲.mp3",#2015-03-10 18:08:49#,3876373,28023.095,-.05,"?"

TOP

3楼pcl_test 网友提供的代码一次取得成功,十分感谢,体现了知识就是生产力,二楼可能理解错了,点击没有反应,但同感谢为之付出了努力

TOP

3楼pcl_test 网友提供的代码一次取得成功,十分感谢,体现了知识就是生产力,二楼可能理解错了,点击没有反应,但同感谢为之付出了努力

TOP

回复 1# hepeisheng
  1. @echo off
  2. for /f "tokens=2 delims=," %%a in ('findstr /r /c:",-.," "信息.txt"') do move %%a "17\"
  3. for /f "tokens=2 delims=," %%b in ('findstr /r /c:",.," "信息.txt"') do move %%b "18\"
  4. for /f "tokens=2 delims=," %%c in ('findstr /r /c:",," "信息.txt"') do move %%c "x\"
  5. for %%a in (*.mp3) do (
  6. findstr /r /c:"%%~na" "信息.txt" || move "%%a" "x\"
  7. for /f "tokens=6 delims=," %%d in ('findstr /r /c:"%%~na" "信息.txt"') do (
  8. for /f "tokens=1* delims=." %%i in ("%%d") do (
  9. if %%i == -16 move "%%a" "01\"
  10. if %%i == -15 move "%%a" "02\"
  11. if %%i == -14 move "%%a" "03\"
  12. if %%i == -13 move "%%a" "04\"
  13. if %%i == -12 move "%%a" "05\"
  14. if %%i == -11 move "%%a" "06\"
  15. if %%i == -10 move "%%a" "07\"
  16. if %%i == -9 move "%%a" "08\"
  17. if %%i == -8 move "%%a" "09\"
  18. if %%i == -7 move "%%a" "10\"
  19. if %%i == -6 move "%%a" "11\"
  20. if %%i == -5 move "%%a" "12\"
  21. if %%i == -4 move "%%a" "13\"
  22. if %%i == -3 move "%%a" "14\"
  23. if %%i == -2 move "%%a" "15\"
  24. if %%i == -1 move "%%a" "16\"
  25. if %%i == 0 move "%%a" "17\"
  26. if %%i == 1 move "%%a" "18\"
  27. if %%i == 2 move "%%a" "19\"
  28. if %%i == 3 move "%%a" "20\"
  29. if %%i == 4 move "%%a" "21\"
  30. if %%i == 5 move "%%a" "21\"
  31. if %%i == 6 move "%%a" "23\"
  32. if %%i == 7 move "%%a" "24\"
  33. if %%i == 8 move "%%a" "25\"
  34. if %%i == 9 move "%%a" "26\"
  35. if %%i == 10 move "%%a" "27\"
  36. if %%i == 11 move "%%a" "28\"
  37. if %%i == 12 move "%%a" "29\"
  38. if %%i == 13 move "%%a" "30\"
  39. )
  40. )
  41. )
  42. pause
复制代码

TOP

本帖最后由 cobat 于 2015-3-11 12:55 编辑
  1. @echo off
  2. (for /f tokens^=3^,4delims^=^" %%a in (a.txt) do (
  3.     set i=%%a
  4.     setlocal enabledelayedexpansion
  5.     for /f "tokens=4 delims=," %%c in ("%%b") do (
  6.         set j=%%c
  7.         if "!j:~,2!" equ "-." move "!i!" 17
  8.         if "!j:~,1!" equ "." move "!i!" 18
  9.         for /f "delims=." %%d in ("%%c") do (
  10.             if %%d geq -16 if %%d leq 13 (
  11.                 if %%d leq 0 (
  12.                     set/a n=%%d+17
  13.                 ) else set/a n=%%d+18
  14.                 set n=0!n!&set n=!n:~-2!
  15.                 move "!i!" !n!
  16.             ) else move "!i!" x
  17.         )
  18.     )
  19.     endlocal
  20. ))>nul 2>nul
  21. pause
复制代码
1

评分人数

TOP

返回列表