Public Function CreateFolder()
Environment.Value("OutSideViwerAutoFolderPath") = "C:\COPEPerlAutomationExecution"
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.FolderExists(Environment.Value("OutSideViwerAutoFolderPath")) = False Then
fs.CreateFolder (Environment.Value("OutSideViwerAutoFolderPath") )
else
Msgbox "Folder Exists"
End if
End Function
Tuesday, October 5, 2010
Read the Value from the Notepad
Call ReadNotepad(oBjmyfile,oBjFileLocation,Trn,oBjAmtDate)
Public Function ReadNotepad(oBjmyfile,oBjFileLocation,Trn,oBjAmtDate)
Const ForReading = 1, ForWriting = 2
myfile = "!!" & Space(1) & "REF" & Space(1) & oBjmyfile
Set FSOj = CreateObject("Scripting.FileSystemObject")
Set oFRead = FSOj.OpenTextFile(oBjFileLocation,ForReading,True)
Do until oFRead.AtEndOfStream
oFRd = oFRead.Readline()
MyValue1 = strcomp(oFRd,myfile,0)
If Myvalue1 = 0 Then
Do until oFRead.AtEndOfStream
mysubfileread = oFRead.Readline()
If left(mysubfileread,4) = ":20:" Then
values = split(mysubfileread,":")
Trn=values(2)
For i=0 to 5
Secondvalue = oFRead.ReadLine()
trimSecondvalue = trim(Secondvalue)
If left(trimSecondvalue,5) = ":32A:" Then
values1 = split(trimSecondvalue,":")
oBjAmtDate=values1(2)
Exit do
End If
elseIf left(trimSecondvalue,5) = ":32B:" Then
values2 = split(trimSecondvalue,":")
oBjAmtDate=values2(2)
Exit do
End If
Next
Exit do
Exit do
End if
Loop
End If
Loop
End Function
Public Function ReadNotepad(oBjmyfile,oBjFileLocation,Trn,oBjAmtDate)
Const ForReading = 1, ForWriting = 2
myfile = "!!" & Space(1) & "REF" & Space(1) & oBjmyfile
Set FSOj = CreateObject("Scripting.FileSystemObject")
Set oFRead = FSOj.OpenTextFile(oBjFileLocation,ForReading,True)
Do until oFRead.AtEndOfStream
oFRd = oFRead.Readline()
MyValue1 = strcomp(oFRd,myfile,0)
If Myvalue1 = 0 Then
Do until oFRead.AtEndOfStream
mysubfileread = oFRead.Readline()
If left(mysubfileread,4) = ":20:" Then
values = split(mysubfileread,":")
Trn=values(2)
For i=0 to 5
Secondvalue = oFRead.ReadLine()
trimSecondvalue = trim(Secondvalue)
If left(trimSecondvalue,5) = ":32A:" Then
values1 = split(trimSecondvalue,":")
oBjAmtDate=values1(2)
Exit do
End If
elseIf left(trimSecondvalue,5) = ":32B:" Then
values2 = split(trimSecondvalue,":")
oBjAmtDate=values2(2)
Exit do
End If
Next
Exit do
Exit do
End if
Loop
End If
Loop
End Function
Find the Notepad File in Specific Folder Location
Public Function FindNotepad()
oBjFolderLocation = "C:\COPEPerlAutomationExecution"
oBjFile Name = "SubfileName.txt"
oBjFileLocationOutSideTestData = Environment.Value("OutSideViwerAutoFolderPath") & "\" & "OutSiderViewerSubfileName.txt"
Msgbox oBjFileLocationOutSideTestData
Set FSOj = CreateObject("Scripting.FileSystemObject")
If (FSOj.FileExists(oBjFileLocationOutSideTestData) = True) Then
Msgbox "Hi"
Set oFRead = FSOj.OpenTextFile(oBjFileLocation,ForReading,True)
Do until oFRead.AtEndOfStream
oFRd = oFRead.Readline()
Msgbox oFRd
loop
MyValue1 = strcomp(oFRd,myfile,0)
If Myvalue1 = 0 Then
Do until oFRead.AtEndOfStream
mysubfileread = oFRead.Readline()
End if
End If
End Function
oBjFolderLocation = "C:\COPEPerlAutomationExecution"
oBjFile Name = "SubfileName.txt"
oBjFileLocationOutSideTestData = Environment.Value("OutSideViwerAutoFolderPath") & "\" & "OutSiderViewerSubfileName.txt"
Msgbox oBjFileLocationOutSideTestData
Set FSOj = CreateObject("Scripting.FileSystemObject")
If (FSOj.FileExists(oBjFileLocationOutSideTestData) = True) Then
Msgbox "Hi"
Set oFRead = FSOj.OpenTextFile(oBjFileLocation,ForReading,True)
Do until oFRead.AtEndOfStream
oFRd = oFRead.Readline()
Msgbox oFRd
loop
MyValue1 = strcomp(oFRd,myfile,0)
If Myvalue1 = 0 Then
Do until oFRead.AtEndOfStream
mysubfileread = oFRead.Readline()
End if
End If
End Function
Subscribe to:
Posts (Atom)