Whether you use the FSO or the old-school file processing methods, the idea is that you need to read one record, or line, from the file at a time, and break it up, or parse it, by the tab delimiter. The easiest way to do that is with the Split function. Here's an example using the old-school file processing methods:
Code:Dim strInputRec As String Dim astrInputFields() As String Open "C:\SomeDir\MyFile.txt" For Input As #1 Do Until EOF(1) Line Input #1, strInputRec astrInputFields = Split(strInputRec, vbTab) ' you can now process the fields. ' astrInputFields(0) will be the first field, (1) will be the second, etc. Loop Close #1




Reply With Quote