本帖最后由 lixiaolong 于 2011-2-26 05:06 编辑
回复 1# kn007
本人没什么技术,随便写了个例子.
为了大家方便,写了一个创建mp3文件代码
#include <file.au3>
$File = @ScriptDir & '\a.txt'
$str = FileOpen($File,0)
While 1
$b = FileReadLine($str)
If $b = '' Then ExitLoop
_FileCreate(@ScriptDir & '\mp3\' & $b)
WEnd
a.txt09 - Spell.mp3
14 - Take Your Time.mp3
06 - Bittersweet.mp3
12 - Lullabye For A Stormy Night.mp3
04 - Bubbly.mp3
09 - One Last Time.mp3
01 - We Are One.mp3
05 - Wish You Well.mp3
06 - Top Of The World.mp3
12 - Chanson de Toile.mp3
23 - A Little Love.mp3
11 - Sabra Girl.mp3
12 - Molde Canticle.mp3
10 - Forgotten Sorrow.mp3
07 - Right Now & Right Here.mp3
04 - End Of May.mp3
06 - Found By You (Acoustic).mp3
10 - I'm in Here.mp3
05 - Lose You.mp3
01 - You Are My Angel (Sub Theme Song In Forensic Heroes 2).mp3
07 - Fairy Tale.mp3
01 - Lonely In Paris.mp3
03 - Good Is Good.mp3
04 - There Were Roses.mp3
10 - Again.mp3
06 - Love Has It All.mp3
06 - Key To My Heart.mp3
02 - Eet.mp3
01 - Grown-Up Christmas List.mp3
02 - 原谅.mp3
09 - Yellow.mp3
08 - 那些花儿.mp3
05 - 亲爱的还幸福吗.mp3
03 - 風の記憶.mp3
10 - 慢慢来比较快.mp3
04 - 花园.mp3
11 - 我懂了.mp3
02 - 相思引.mp3
02 - 春の风.mp3
07 - 我真的受伤了.mp3
01 - 错过.mp3
05 - ???? ????.mp3
03 - 怎么说呢_.mp3
07 - 夏天的风.mp3
01 - 岛歌.mp3
01 - 日光倾城.mp3
改名例子
#include <file.au3>
_ReName(@ScriptDir & '\mp3')
Func _ReName($SearchDir)
Dim $szDrive, $szDir, $szFName, $szExt
$aFile = _FileListToArray($SearchDir)
If Not @error Then
For $i = 1 To $aFile[0]
$arrPath = _PathSplit($SearchDir & '\' & $aFile[$i], $szDrive, $szDir, $szFName, $szExt)
$Test2 = StringRegExpReplace($szFName & $szExt, '(\d+)(?= -)', '')
If $i < 10 Then
$FileName = '0' & $i & $Test2
Else
$FileName = $i & $Test2
EndIf
RunWait(@ComSpec & ' /c ren "' & $SearchDir & '\' & $aFile[$i] & '" "' & $FileName & '"', '', 0)
Next
EndIf
EndFunc ;==>_ReName
|