- Home
·
- Miscellaneous
·
- This Code Read the Filenames From partcular folder and Convert the String in to database Feilds ...
This Code Read the Filenames From partcular folder and Convert the String in to database Feilds ...
This Code Read the Filenames From partcular folder and Convert the String in to database Feilds ..... Feel Free to ask more on this......NJOY
Rate This Code Read the Filenames From partcular folder and Convert the String in to database Feilds ...
(1(1 Vote))
Dim cnt As Integer
Dim Str As String
Dim fso, f, f1, fc, Filename
Dim Win As String
Dim Fdate As String
Dim Str1 As String
Open_FlatFile1 ' Open Recordset of flat file
Open_Convertlog
Set fso = CreateObject("Scripting.FileSystemObject") 'Created Object To read file from Folder
Set f = fso.GetFolder(App.Path + "\FlatFile\")
Set fc = f.Files
For Each f1 In fc
Filename = f1.Name
Win = Mid(Filename, 5, 4)
pathname = App.Path + "\FlatFile\" + Filename
Open pathname For Input As #1
Do While EOF(1) = False
Line Input #1, Str
cnt = cnt + 1
If cnt = 6 Then
Fdate = Right(Str, 10)
End If
If cnt >= 11 Then
If IsNumeric(Mid(Str, 1, 1)) Then
Rsp1.AddNew
Rsp1.Fields!Window = Win
Rsp1.Fields!sample = Mid(Str, 1, 8)
Rsp1.Fields!phoneNr = Mid(Str, 9, 11)
Rsp1.Fields!Time = Mid(Str, 21, 2) + ":" + Mid(Str, 24, 2)
Rsp1.Fields!Line = Val(Mid(Str, 26, 5))
Rsp1.Fields!ECE = Mid(Str, 31, 25)
Rsp1.Update
Else
Exit Do
End If
End If
Loop
MsgBox "File Converted Successfully!"
cnt = 0
Close #1
next
This Code Read the Filenames From partcular folder and Convert the String in to database Feilds ... Comments
No comments yet — be the first to post one!
Post a Comment