Finally...
Sub ParseTextFile2b()
' Parses a multi-line text file
Dim vText, vTmp, n&, k&
Const sFile$ = "C:\Data.txt"
'//where the file contains
'a123 A. BC #123
'b123 B. CD #123
'c123 C. DE #123
'Get the file contents and parse each line
vText = Split(ReadTextFile(sFile), vbCrLf)
'Parse each line in the file
For k = LBound(vText) To UBound(vText)
'Get the line text parsed by 'TAB' characters
vTmp = Split(vText(k), vbTab)
For n = LBound(vTmp) To UBound(vTmp)
Debug.Print vTmp(n)
Next 'n
'Parse the 2nd element by 'SPACE' characters
vTmp = Split(vTmp(1), " ")
For n = LBound(vTmp) To UBound(vTmp)
Debug.Print vTmp(n)
Next 'n
Next 'k
End Sub
...which returns the following:
a123
A. BC #123
A.
BC
#123
b123
B. CD #123
B.
CD
#123
c123
C. DE #123
C.
DE
#123
--
Garry
Free usenet access at
http://www.eternal-september.org
Classic
VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.
vb.general.discussion