本帖最后由 skyfree 于 2018-8-31 12:08 编辑
AutoItSetOption('MustDeclareVars', 1)
#include <Array.au3>
#include <File.au3>
_Main()
Exit
Func _Main()
Local $sInputDir = @ScriptDir & '\Files'
Local $aFileList = _FileListToArray($sInputDir, '*.xls', 1)
;;_ArrayDisplay($aFileList, '$aFileList')
Local $i, $sNewFileName, $aTemp
For $i = 1 To UBound($aFileList, 1) - 1
$aTemp = StringRegExp($aFileList[$i], '(?i)^Type (\d{1,3})\.xls$', 2)
If Not (@error) Then
$sNewFileName = 'Type ' & String(Int($aTemp[1])) & '.xls'
FileMove($sInputDir & '\' & $aFileList[$i], $sInputDir & '\' & $sNewFileName, 1)
EndIf
Next
MsgBox(64, '', 'OK!')
EndFunc ;==>_Main
$sInputDir 的值改成你存放文件的目录的绝对路径
|