Hello, I am trying to read a text file that contains some start characters but it can vary in the amount of elements indicating its cost and in the end the total sum. After generating the list it must be shown on the page in the order in which appear in the file.txt.
File.txt This document has ASCII characters FS, SI and CRLF
EchoFSSIB@ 20 BOX X 1 = 20CRLF
500 BOX X 1 = 500CRLF
TOTAL = 520 USD
Vbs
Dim itr
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("c:\temp\Archivo.txt")
If objFile.Size > 0 Then
Set objReadFile = objFSO.OpenTextFile("c:\temp\Archivo.txt", 1)
strContents = objReadFile.ReadAll
itr = strContents
objReadFile.Close
End If
dim scrns
scrns = Split(itr, Chr(32),-1,1)
dim s1
s1 = Replace(itr,scrns(0),"")
dim scr
scr = Split(s1,Chr(13),-1,1)
For count = 0 to Ubound(scr)
sss = sss + scr(count)& vbNewLine
Next
AmountBox.innerhtml = sss