-2
특정 폴더의 특정 국가 파일 이름을 제외하는 방법에 대한 도움이 필요합니다.VB 스크립트에서 국가 파일 폴더 및 파일 이름을 제외하십시오.
DIM datasource
datasource = objRs.Fields(0).Value
Region = replace(objRs.Fields(1).Value," ","_",1,-1,0)
CountryCode = Region &"_"& serialNumber1
'-----------------------------------------------------------------
'Region subfolder creation
packageCountryDataPath = outputfolder&"\"& Region
If Not fso.FolderExists(packageCountryDataPath) Then
fso.CreateFolder(packageCountryDataPath)
WScript.Echo "Regions Folders created: " & Region & ""
End If
나는 UN & MA와 같은 특정 국가 폴더를 exlcude 싶다. 이 폴더를 생성하고 싶지 않습니다.
Do Until objRs.EOF
datasource = objRs.Fields(0).Value
WScript.Echo datasource
Region = replace(objRs.Fields(1).Value," ","_",1,-1,0)
CountryCode = Region &"_"& serialNumber1
'-----------------------------------------------------------------
'Region subfolder creation
packageCountryDataPath = outputfolder&"\"& Region
If Not fso.FolderExists(packageCountryDataPath) Then
fso.CreateFolder(packageCountryDataPath)
WScript.Echo "Regions Folders created: " & Region & ""
End If
WScript.Echo "Regions Folders created: " & packageCountryDataPath & ""
Set folder = fso.GetFolder(Inputfile)
Set files = folder.Files
For each item In files
If Instr(item.Path,".xml") <> 0 then
logfilename =item.Name
logfilename= replace(logfilename,".xml","",1,-1,0)
returnValue = exportDatasource(item.Path,logfolder&"\"& logfilename &".log", datasource, CountryCode, DateTime, utilsfolder, packageCountryDataPath, dbDataSource, dbLogin, dbPassword)
If returnValue = 0 Then
'WScript.Echo "Datasource " & Region & " processed"
Else
WScript.Echo "Error while processing Datasource " & Region
Exit Do
End If
End If
이 작업을 수행하는 방법을 알려주십시오.
많은 도움에 감사드립니다.
가 파일명의 일부 예를 제공 포함 및 제외한다. –
[mcve]를 제공하십시오. – Heinzi
'outputfolder'는 어떻게 정의되어 있습니까? – Icepickle