Database Reference
In-Depth Information
Convert.ToBoolean(Dts.Variables("ExceptionOnFileNotFound").Value)
Dim bCopyOnly As Boolean
= Convert.ToBoolean(Dts.Variables("CopyOnly").Value)
Dim sFileName As String
Dim sBaseFileName As String
Dim sExtension As String
Dim sSourceFileDirectory As String
Dim sWorkingCopyFileName As String
Dim sFormattedFileName As String
Dim sMsg As String
' 4: work with the file
Try
' 4a: parse the source file directory...
sSourceFileDirectory
= Strings.Trim(Strings.Left(sSourceFilePath, _
Strings.InStrRev(sSourceFilePath, "\")))
' 4b: parse the filename...
sFileName
= Strings.Trim(Strings.Right(sSourceFilePath, _
Strings.Len(sSourceFilePath)
- Strings.InStrRev(sSourceFilePath, "\")))
' 4c: parse the filepath minus the
extension...
sBaseFileName = Strings.Left(sSourceFilePath,
Strings.InStrRev(sSourceFilePath, _
".") - 1)
' 4d: build working copy file name...
sWorkingCopyFileName = sSourceFileDirectory &
"_" & sFileName
' 4e: parse extension...
sExtension
= Strings.Trim(Strings.Right(sSourceFilePath, _
Strings.Len(sSourceFilePath)
- Strings.InStrRev(sSourceFilePath, ".")))
' 4f: apply formatting to filename and set
the output value of FormattedFileName
Search WWH ::




Custom Search