我在 vb 脚本中有这一行:
fileCheck = Right(objLookFile.name, len(objLookFile.name) - len("Audit_######_"))
现在Audit_######_
需要6位数。我遇到了一种情况,我有 7 位数字和 8 个文件的前文件:Audit_1002611_Company_MTH_11_2013.00001.txt
如何更改######
以接受任意位数?
dim lookFor
lookFor = fiRef(i_fi) & "_" & AIOType(i_type) & "_" & Right("00" & (month(processDate + 1)), 2) & "_" & Year(processDate + 1) & ".00001.txt"
dim minLen
minLen = len(lookFor)
dim objLookFolder, objLookFile
set objLookFolder = objFSO.GetFolder(AIODVDDir)
For each objLookFile in objLookFolder.files
if Len(objLookFile.name) >= minLen then
dim fileCheck
fileCheck = Right(objLookFile.name, len(objLookFile.name) - len("Audit_######_"))
if (Left(objLookFile.name, len("Audit_")) = "Audit_") AND (fileCheck = LookFor) then
'found the audit file
谢谢