Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder(".") '目前目錄 Set fc = f.Files
For Each f1 in fc fileName = f1.name baseName = fso.GetBaseName(fileName)
columnG=fileName
ReDim tmpPart(10) totalPartNum=0 For i=1 to Len(baseName) c=Mid(baseName,i,1) If InStr(ingore,c)=0 Then ''不在忽略的字串裡 If InStr(spliter,c)>0 Then totalPartNum = totalPartNum+1 Else tmpPart(totalPartNum) = tmpPart(totalPartNum) & c End If End If Next
ReDim Preserve tmpPart(totalPartNum)
columnD="" columnF="" For i=0 to UBound(tmpPart) If i = UBound(tmpPart) Then ''最後一個部份是檔名 columnF=tmpPart(i) Else ''其他是歌手名稱 If not columnD="" Then columnD=columnD & "&" columnD=columnD & tmpPart(i) End If Next