juiyuang / p1

p1
0 stars 0 forks source link

vbs #4

Open juiyuang opened 2 years ago

juiyuang commented 2 years ago

strFilePath = "\tkymkdb001\E$\Prod\Datafeed\WGBI\PortfolioChara\D_IT\20211119\SL_WJITDR_20211119.csv"

strDir = "\oskdevint001\d$\batch\WGBI\data\PortfolioChara\D_IT\"

Set objFS = CreateObject("Scripting.FileSystemObject")

objFS.CopyFile strFilePath, strDir, True

juiyuang commented 2 years ago

Function copy3Files() Dim dateString, basePath, sourcePath, fullPath, destinationPath, fileA, fileB, fileC As String Set fileObject = CreateObject("Scripting.FileSystemObject")

dateString = Format(Date - 1, "yyyymmdd")

' change these values basePath = "C:\FiverrTask\source\" destinationPath = "C:\FiverrTask\destination\"

sourcePath = basePath + dateString + "\"

fileA = "A" + dateString + ".csv" fileB = "B" + dateString + ".csv" fileC = "C_" + dateString + ".csv"

fileObject.CopyFile (sourcePath & fileA), destinationPath, True fileObject.CopyFile (sourcePath & fileB), destinationPath, True fileObject.CopyFile (sourcePath & fileC), destinationPath, True

End Function

juiyuang commented 2 years ago

' 20211126 test ファイルコピー---------------------------------------------------------- Dim dateString, basePath, sourcePath, destinationPath, fileA As String Set fileObject = CreateObject("Scripting.FileSystemObject") ' past 3 day file dateString = Format(Date - 3, "yyyymmdd") basePath = "\tkymkdb001\E$\Prod\Datafeed\WGBI\PortfolioChara\D_IT\" destinationPath = "\oskdevint001\d$\batch\WGBI\data\PortfolioChara\D_IT\" sourcePath = basePath + dateString + "\" fileA = "SLWJITDR" + dateString + ".csv" fileObject.CopyFile (sourcePath & fileA), destinationPath, True

juiyuang commented 2 years ago

' 20211126 test ファイルコピー---------------------------------------------------------- Dim dateString, basePath, sourcePath, destinationPath, fileA As String Set fileObject = CreateObject("Scripting.FileSystemObject") ' past 3 day file dateString = Format(Date - 3, "yyyymmdd") basePath = "\tkymkdb001\E$\Prod\Datafeed\WGBI\PortfolioChara\D_IT\" destinationPath = "\oskdevint001\d$\batch\WGBI\data\PortfolioChara\D_IT\" sourcePath = basePath + dateString + "\" fileA = "SLWJITDR" + dateString + ".csv" fileObject.CopyFile (sourcePath & fileA), destinationPath, True

juiyuang commented 2 years ago

Dim dateString, basePath, sourcePath, destinationPath, fileA, fileB, fileC As String Set fileObject = CreateObject("Scripting.FileSystemObject")

dateString = Format(Date - 1, "yyyymmdd")

' change these values basePath = "C:\FiverrTask\source\" destinationPath = "C:\FiverrTask\destination\"

sourcePath = basePath + dateString + "\"

fileA = "A_" + dateString + ".csv"

If Not FSO.FileExists(sourcePath & fileA) Then MsgBox "Specified File Not Found", vbInformation, "Not Found" Else fileObject.CopyFile (sourcePath & fileA), destinationPath, True End if

juiyuang commented 2 years ago

Function move1file() Dim dateString, basePath, sourcePath, destinationPath, fileA, fileB, fileC As String Set fileObject = CreateObject("Scripting.FileSystemObject")

dateString = Format(Date - 1, "yyyymmdd")

' change these values basePath = "C:\FiverrTask\source\" destinationPath = "C:\FiverrTask\destination\"

sourcePath = basePath + dateString + "\"

fileA = "A_" + dateString + ".csv" MsgBox sourcePath & fileA

If Not fileObject.FileExists(sourcePath & fileA) Then MsgBox "Specified File Not Found", vbInformation, "Not Found" Else fileObject.CopyFile (sourcePath & fileA), destinationPath, True End If End Function