D
David
Hello all,
I have a very large but odd text file. It has only one row, with 5 fields.
The fourth field, RULE_TEXT has all of the data I want with the data elements
seperated by a semi-colon.
I would like the create a table from data in Field4, with each semi-colon
creating a new row in the table.
I am using this code I found in another post and trying to modify it, but I
receive on line 100, the error 62, Input past end of file.
Function ReadTextFile()
Dim strFile As String
Dim intF As Integer
Dim strLineBuf As String
Dim rstData As DAO.Recordset
10 Set rstData = CurrentDb.OpenRecordset("tbl_TABLE_RULE")
20 strFile = "C:\Program Files\Database\table_rule.txt"
30 intF = FreeFile()
40 Open strFile For Input As #intF
50 Do While EOF(intF) = False
60 rstData.AddNew
70 Line Input #intF, strLineBuf
80 Line Input #intF, strLineBuf
90 Line Input #intF, strLineBuf
100 rstData!RULE_TEXT = Split(strLineBuf, ";")(-1)
110 Line Input #intF, strLineBuf
120 rstData.AddNew
130 Loop
140 Close intF
End Function
Any assistance you can provide is greatly appreciated.
David
I have a very large but odd text file. It has only one row, with 5 fields.
The fourth field, RULE_TEXT has all of the data I want with the data elements
seperated by a semi-colon.
I would like the create a table from data in Field4, with each semi-colon
creating a new row in the table.
I am using this code I found in another post and trying to modify it, but I
receive on line 100, the error 62, Input past end of file.
Function ReadTextFile()
Dim strFile As String
Dim intF As Integer
Dim strLineBuf As String
Dim rstData As DAO.Recordset
10 Set rstData = CurrentDb.OpenRecordset("tbl_TABLE_RULE")
20 strFile = "C:\Program Files\Database\table_rule.txt"
30 intF = FreeFile()
40 Open strFile For Input As #intF
50 Do While EOF(intF) = False
60 rstData.AddNew
70 Line Input #intF, strLineBuf
80 Line Input #intF, strLineBuf
90 Line Input #intF, strLineBuf
100 rstData!RULE_TEXT = Split(strLineBuf, ";")(-1)
110 Line Input #intF, strLineBuf
120 rstData.AddNew
130 Loop
140 Close intF
End Function
Any assistance you can provide is greatly appreciated.
David