Function Main()
CONST ForReading = 1
dim objInterfaceFile
dim objInterfaceLVL
dim objInterfaceCOR
dim objFSO
dim objStoreCountFile
dim fileInput
dim fileLVL
dim fileCOR
dim strHoldValue
dim intPointer
dim intPointer2
dim i
objInterfaceFile = DTSGlobalVariables("strInterfacePath").Value & "LearningCenter\EmployeeTLC.int"
objInterfaceLVL = DTSGlobalVariables("strInterfacePath").Value & "LearningCenter\LVLEmployeeTLC.int"
objInterfaceCOR = DTSGlobalVariables("strInterfacePath").Value & "LearningCenter\COREmployeeTLC.int"
' instantiate the Scripting Object
set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(objInterfaceCOR) Then
objFSO.DeleteFile(objInterfaceCOR)
end if
If objFSO.FileExists(objInterfaceLVL) Then
objFSO.DeleteFile(objInterfaceLVL)
end if
SET fileLVL = objFSO.CreateTextFile(objInterfaceLVL, false)
SET fileCOR = objFSO.CreateTextFile(objInterfaceCOR, false)
fileLVL.WriteLine "DUM||||||||||"
fileCOR.WriteLine "DUM|||||||||||"
SET fileInput = objFSO.OpenTextFile(objInterfaceFile, ForReading)
strHoldValue = fileInput.Readline
Do while fileInput.AtEndOfStream <> True
SELECT CASE Left(strHoldValue,3)
CASE "COR"
fileCOR.WriteLine strHoldValue
CASE "LVL"
fileLVL.WriteLine strHoldValue
CASE ELSE
intpointer2 = 1
For i = 1 To 4
intPointer = InStr(intPointer2, strHoldValue, "|")
intpointer2 = intPointer + 1
Next
strHoldValue = "COR|" & Left(strHoldValue,intPointer) & "|" & Mid(strHoldValue,intPointer + 1, Len(strHoldValue) - intPointer)
fileCOR.WriteLine strHoldValue
END SELECT
strHoldValue = fileInput.Readline
Loop
fileInput.Close
SET fileInput = Nothing
SET fileLVL = Nothing
SET fileCOR = Nothing
SET objFSO = Nothing
Main = DTSTaskExecResult_Success
End Function