Hello,
I'm working on a program that needs to parse a text file, pulling out
a field and it's corresponding value. The fields I need to search for
are in a text file, one field per line. All of this is really simple
and straightforward to me, but I cannot figure out why my output (to
the console) is not what I expect.
Below is the portion of my code that is of interest and below that is
the output I'm getting.
So that you do not have to guess at what I'm talking about. Let me
point out the line:
out.Write(trim(tmp) & "e")
But the output that I get is: "e4"
There should be an "A" where the "e" is and the "e" should be AFTER
the "4".
Thanks for the help!
********CODE***********
Set out = Wscript.StdOut
' Read in fields
out.Write("Reading fields... ")
set txt = fs.OpenTextFile(cfgFieldsFile,1)
aryFields = trim(txt.ReadAll)
txt.Close
aryFields = split(aryFields,chr(10))
out.WriteLine((Ubound(aryFields)+1) & " fields found")
If dbgShowFields Then
For Each tmp in aryFields
out.Write(trim(tmp) & "e")
out.WriteBlankLines(1)
Next
End If
aryFields = join(aryFields," ")
out.writeline("start " & aryFields & " end")
out.writeline(len(aryFields))
**********OUTPUT**************
Reading fields... 30 fields found
e4
eSTG3
eell
eode
e3d2fb
e44d4
e5d45
esn
e
e2fb
e3qp2
ebar
ecell
ecfb
e3fb
edg
ehp
ehpmr1
ehpr1
e2
e3f
e5m
edate
ehpg1
ear0
efkrk
etime
egturn
enf
xnge