split a tab delimited string

  • Thread starter Thread starter Ajit
  • Start date Start date
A

Ajit

I have a tab delimited string and i want to split it to read all the values
from the string

I tried multiple way but doesn't work with ASP.Net

i tried
aryData = strData.Split(vbTab)

aryData = strData.Split(Chr(9))

aryData = strData.Split("\t")

aryData = strData.Split(ControlChars.Tab)

but none of them work

any idea why or has anyone done something like this.

I will appreciate if anyone can help me out of this
 
aryData = strData.Split("\t")

I believe that I'm using this with '\t' and it's working well. What's the
problem you're seeing? If you still having problems, post your tab-delimited
file and I'll take a look for you this evening.

Scott
 
Option Strict On

Imports System.IO

Module Module1

Sub Main()
Dim fs As New FileStream("c:\tab.txt", FileMode.Open)
Dim sr As New StreamReader(fs)

Dim x() As String = sr.ReadLine().Split(CType(vbTab, Char))
End Sub

End Module

Haven't actually tried in a ASP.NET application.

HTH,
Greg
 
Hi Greg

I tried aryData = strData.Split(CType(vbTab, Char))
and it give me error msg
Compiler Error Message: BC30451: Name 'vbTab' is not declared

thanx,

Ajit.
 
Hi Scott,

I tried
aryData = strData.Split("\t") ' Tab delimited

Response.Write(aryData(0))

Response.Write(aryData(1))

Response.Write(aryData(2))

Response.Write("<BR>")

And please find attached tab_delimit.txt

as a tab delimited file.

thanx,

Ajit.
 
Hi Greg,

Thanq very much it worked.
I appreciate your help.

Actually, i had
Imports Microsoft.VisualBasic.filesystem
and the other way was i redirected the page to ASP to make it working
but i wanted to do with ASP.Net

thanx once again,

Ajit.
 
Back
Top