"henrique" <qwqwq@xxxxxx> wrote in message
news:94C154D2-0BBC-41AD-B89E-043BCA49CE75@xxxxxx
Quote:
> Hi
>
> Is possible to help me to read a text file, line by line, and place it
> into an arry?
>
> code VBScript
>
> 'Text file opened with notepad
> 25-07-2008 20:34:35 I/OManager Alto Routing error1 : Low
> 25-07-2008 20:34:36 I/OManager Alto Routing error7 : Low
> 25-07-2008 20:34:36 I/OManager Alto Routing error2 : Low
> 25-07-2008 20:34:36 I/OManager Alto Routing error2 : Low
> 25-07-2008 20:34:36 I/OManager Alto Routing error3 : Low
> 25-07-2008 20:34:38 I/OManager Alto Routing error6 : Low
> 25-07-2008 20:34:40 I/OManager Alto Routing error 8: Low
> 25-07-2008 20:34:42 I/OManager Alto Routing error1 : Low
>
> Thank you in advance
>
> H.S.
There are a few ways to do this. Here is one of them:
CRLF = Chr(13) & Chr(10)
sFileName = "d:\temp\test.txt"
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFile = oFSO.OpenTextFile(sFileName)
aFileArray = Split(oFile.ReadAll, CRLF)