home
DTS Activex finding if a text file exists and has data
Author Nigel Rivett
The DTS step will take the error path if the file does not exist.
Put in your own processing for empty files.
dim objFSys
dim objFStream
dim sLine
Set objFSys = CreateObject("Scripting.FileSystemObject")
Set objFStream = fsys.OpenTextFile(strSwiftedFile, 1, 0)
sLine = objFStream.ReadLine
if trim(sLine) = "" then
' no data in file
else
' data in file
end if
objFStream.Close
Set objFStream = Nothing
set objFSys = nothing
home