yesilkalem
IS-IT--Management
hello ..
I have a text file that captured from a terminal screen ..
now I have to analize this text file with access. and I have done this. but have a problem of course ..
I have written a module .. but the in the last column it does not work properly.. I need to concatenate or combine raw1, raw2, raw3... etc. but it combines raw 1, raw2, raw4, raw3 ..
this is my module :
Sub textoku()
Dim db As Database
Dim tb As Recordset
Dim tb1 As Recordset
Dim tb2 As Recordset
Dim tb3 As Recordset
Dim myrec As String * 80
Dim acýk As String
Dim cumle, cumle2, cumle3 As String
Dim sakla As String * 8
Dim TARIH As String * 10
Dim sayý As Integer
Dim myf As Form
Dim sourcefile
sourcefile = Forms!frmtext![DOSYA]
Open sourcefile For Input As #1
Set db = CurrentDb()
db.Execute "delete * from capdata"
Set tb = db.OpenRecordset("capdata"
tb.Index = "PrimaryKey"
sayý = 0
Line Input #1, myrec
Line Input #1, myrec
Do While Not EOF(1)
Line Input #1, myrec
If Left$(myrec, 1) = "-" Then GoTo devam
If Left$(myrec, 8) <> " " Then
sayý = 0
sakla = Left$(myrec, 8)
TARIH = Mid$(myrec, 10, 2) & "." & Mid$(myrec, 13, 2) & "." & Mid$(myrec, 16, 4)
End If
If Val(Mid$(myrec, 30, 17)) = 0 Then
tb.Seek "=", sakla, 2
tb.Edit
tb("ACIKLAMA"
= tb("ACIKLAMA"
& Mid$(myrec, 55, 26)
acýk = tb("ACIKLAMA"
tb.Update
GoTo devam
End If
tb.AddNew
sayý = sayý + 1
tb("SIRA"
= sayý
tb("FISNO"
= sakla
tb("TARIH"
= TARIH
tb("HESAP"
= Mid$(myrec, 21, 8)
tb("b/A"
= Mid$(myrec, 29, 1)
tb("MEBLAG"
= Int(Mid$(myrec, 30, 17))
tb("DOVIZ"
= Mid$(myrec, 50, 3)
acýk = ""
acýk = Trim(Mid$(myrec, 55, 26))
tb("ACIKLAMA"
= acýk
tb.Update
devam:
Loop
kapat:
tb.Close
MsgBox ("Text Datasý Aktarýldý"
db.Close
End Sub
this is my text file.. please copy it to a text file
I have a text file that captured from a terminal screen ..
now I have to analize this text file with access. and I have done this. but have a problem of course ..
I have written a module .. but the in the last column it does not work properly.. I need to concatenate or combine raw1, raw2, raw3... etc. but it combines raw 1, raw2, raw4, raw3 ..
this is my module :
Sub textoku()
Dim db As Database
Dim tb As Recordset
Dim tb1 As Recordset
Dim tb2 As Recordset
Dim tb3 As Recordset
Dim myrec As String * 80
Dim acýk As String
Dim cumle, cumle2, cumle3 As String
Dim sakla As String * 8
Dim TARIH As String * 10
Dim sayý As Integer
Dim myf As Form
Dim sourcefile
sourcefile = Forms!frmtext![DOSYA]
Open sourcefile For Input As #1
Set db = CurrentDb()
db.Execute "delete * from capdata"
Set tb = db.OpenRecordset("capdata"
tb.Index = "PrimaryKey"
sayý = 0
Line Input #1, myrec
Line Input #1, myrec
Do While Not EOF(1)
Line Input #1, myrec
If Left$(myrec, 1) = "-" Then GoTo devam
If Left$(myrec, 8) <> " " Then
sayý = 0
sakla = Left$(myrec, 8)
TARIH = Mid$(myrec, 10, 2) & "." & Mid$(myrec, 13, 2) & "." & Mid$(myrec, 16, 4)
End If
If Val(Mid$(myrec, 30, 17)) = 0 Then
tb.Seek "=", sakla, 2
tb.Edit
tb("ACIKLAMA"
acýk = tb("ACIKLAMA"
tb.Update
GoTo devam
End If
tb.AddNew
sayý = sayý + 1
tb("SIRA"
tb("FISNO"
tb("TARIH"
tb("HESAP"
tb("b/A"
tb("MEBLAG"
tb("DOVIZ"
acýk = ""
acýk = Trim(Mid$(myrec, 55, 26))
tb("ACIKLAMA"
tb.Update
devam:
Loop
kapat:
tb.Close
MsgBox ("Text Datasý Aktarýldý"
db.Close
End Sub
this is my text file.. please copy it to a text file