split a tab delimited string

Discussion in 'ASP .Net' started by Ajit, Jul 28, 2003.

  1. Ajit

    Ajit Guest

    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
    Ajit, Jul 28, 2003
    #1
    1. Advertising

  2. Ajit

    Scott Carter Guest

    > 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
    Scott Carter, Jul 28, 2003
    #2
    1. Advertising

  3. Ajit

    Greg Burns Guest

    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

    "Ajit" <> wrote in message
    news:...
    >
    > 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
    >
    >
    >
    >
    >
    Greg Burns, Jul 28, 2003
    #3
  4. Ajit

    Ajit Guest

    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.




    "Greg Burns" <> wrote in message
    news:...
    > 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
    >
    > "Ajit" <> wrote in message
    > news:...
    > >
    > > 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
    > >
    > >
    > >
    > >
    > >

    >
    >
    Ajit, Jul 28, 2003
    #4
  5. Ajit

    Ajit Guest

    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.






    "Scott Carter" <scott[the letter c] [ @ ] turbopower[DOTnet]> wrote in
    message news:uKBS$...
    > > 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
    >
    >
    Ajit, Jul 28, 2003
    #5
  6. Ajit

    Greg Burns Guest

    Add this line to top of your file:

    Imports Microsoft.VisualBasic

    Greg

    "Ajit" <> wrote in message
    news:...
    > 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.
    >
    >
    >
    >
    > "Greg Burns" <> wrote in message
    > news:...
    > > 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
    > >
    > > "Ajit" <> wrote in message
    > > news:...
    > > >
    > > > 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
    > > >
    > > >
    > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Greg Burns, Jul 28, 2003
    #6
  7. Ajit

    Ajit Guest

    It worked Re: split a tab delimited string

    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.



    "Greg Burns" <> wrote in message
    news:...
    > Add this line to top of your file:
    >
    > Imports Microsoft.VisualBasic
    >
    > Greg
    >
    > "Ajit" <> wrote in message
    > news:...
    > > 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.
    > >
    > >
    > >
    > >
    > > "Greg Burns" <> wrote in message
    > > news:...
    > > > 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
    > > >
    > > > "Ajit" <> wrote in message
    > > > news:...
    > > > >
    > > > > 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
    > > > >
    > > > >
    > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Ajit, Jul 29, 2003
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Angus
    Replies:
    6
    Views:
    2,106
    Dag Sunde
    Nov 17, 2006
  2. RyanL
    Replies:
    6
    Views:
    667
    Paul McGuire
    Aug 28, 2007
  3. Sam Kong
    Replies:
    5
    Views:
    221
    Rick DeNatale
    Aug 12, 2006
  4. PerlFAQ Server
    Replies:
    0
    Views:
    378
    PerlFAQ Server
    Jan 25, 2011
  5. PerlFAQ Server
    Replies:
    0
    Views:
    461
    PerlFAQ Server
    Apr 13, 2011
Loading...

Share This Page