tab character - how to
I am using the vbscript activity to read a tab delimited text file.
using the split statement below does not split string, so what should the split character be or how should i be parsing the line into fields, (cant use space or comma)
Dim sr As StreamReader = New StreamReader(my_file_path)
Do While sr.Peek() > 0
py_text = sr.readline()
if py_text.length > 0 then
py_array = py_text.Split(New [Char]() {CChar("\t")})
endif
Loop
-
Hi Jeff,
A nice and clean way of doing this is to use ControlChars:
py_array = py_text.Split(ControlChars.Tab)
ControlChars is in Microsoft.VisualBasic.dll.
Cheers
0 -
to i need to specify that dll in some way or is it built into the vbscript activity?
0 -
py_array = py_text.Split(microsoft.visualbasic.ControlChars.Tab)
so you have to specify the whole name space instead of just the last part!
but thanks for helping and getting me on the right track!
J
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare