split a tab delimited string

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
 
S

Scott Carter

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
 
G

Greg Burns

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
 
A

Ajit

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.
 
A

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.
 
A

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top