brute-force way is to parse the input looking for CHR$(9), which is the <TAB> character. Use the INSTR function to find the first tab, hack off the first field, then call INSTR again with the startpos argument, to find the next tab. repeat until you run out of input.
Do you want to read them directly into a SQL database table by any chance? If so, you can do in one line of SQL using BULK INSERT. Not sure if any similar capability is available in Access.
If SQL is available to you, you could load into a temporary table to save yourself the parsing then do whatever you need with fields from the table.
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
Private Function ReadTextFile(ByVal sPath As String, ByVal sFile As String) As DAO.Recordset
On Error GoTo fix_err
Dim Db As DAO.Database
Dim rs As DAO.Recordset
Set Db = OpenDatabase(sPath, False, True, "Text; HDR=YES; IMEX=1;"
Set rs = Db.OpenRecordset("SELECT * FROM " & sFile)
rs.MoveFirst
Set ReadTextFile = rs
Set rs = Nothing
Exit Function
fix_err:
MsgBox Err.Description + " " + _
Err.Source, vbCritical, "Import"
Err.Clear
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.