Re: Readall command



"indyboy" <dontread@xxxxxxxxxxx> wrote in message
news:1133284088.628026.296590@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> 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
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


.



Relevant Pages

  • Re: Unrecoverable error 332 string/array memory overflow
    ... When you AADDto an array the existing array is copied with the extra amount ... of memory added for the new element, so doing that involves a lot of memory ... // Write the array to DBF ... UpdateDBF(aLines) ...
    (comp.lang.clipper)
  • Re: Memo Fields
    ... next to Gerben and Lees suggestions, maybe you are looking for ALines. ... copies each line in a memo into an array. ... I've used memo fields in tables, ...
    (microsoft.public.fox.programmer.exchange)