James
Tue Nov 29 12:05:57 CST 2005
"indyboy" <dontread@indy.rr.com> wrote in message
news:1133284088.628026.296590@g47g2000cwa.googlegroups.com...
> How do I read a text file into an array except the first five lines?
You could use the 'skipline' method to move down 5 lines and then use the
'split' function to split the file into an array.
SkipLine Method:
http://msdn.microsoft.com/library/en-us/script56/html/wsmthskipline.asp
Split Function:
http://msdn.microsoft.com/library/en-us/script56/html/vsfctsplit.asp
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim oFSO, oInputFile, aLines, i
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oInputFile = oFSO.OpenTextFile("myfile.txt", 1)
For i = 1 to 5
oInputFile.SkipLine
Next
aLines = Split(oInputFile.ReadAll(), vbCrLf)
oInputFile.Close
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~