none
Split tab delimited flat file in script component RRS feed

  • Question

  • I am using a script component as a source to read from a flat file which is tab delimited..Can anyone tell me how to split the row into columns in vb..

    e.g.

    Dim columnArray As String() = line.Split(Convert.ToChar(" "))

    This code is not working as I am getting an error that the splitting string should be exactly one character long..

    Thanks in advance

    Wednesday, July 11, 2012 1:13 AM

Answers

  • try

    Dim columnArray As String() = line.Split(vbTab)


    Rgds Geoff
    ----------------------------------------------------------
    Mark as Answer if this resolves your problem or "Vote as Helpful" if you find it helpful.

    • Marked as answer by rockstar283 Wednesday, July 11, 2012 2:02 AM
    Wednesday, July 11, 2012 1:49 AM
  • Thank you for the heads up..

    This worked..

    Dim columnArray As String() = line.Split(CChar(vbTab))

    • Marked as answer by rockstar283 Wednesday, July 11, 2012 2:02 AM
    Wednesday, July 11, 2012 2:02 AM

All replies

  • Can anyone help me out here..


    • Marked as answer by rockstar283 Wednesday, July 11, 2012 1:36 AM
    • Unmarked as answer by rockstar283 Wednesday, July 11, 2012 1:46 AM
    • Edited by rockstar283 Wednesday, July 11, 2012 1:46 AM
    Wednesday, July 11, 2012 1:36 AM
  • try

    Dim columnArray As String() = line.Split(vbTab)


    Rgds Geoff
    ----------------------------------------------------------
    Mark as Answer if this resolves your problem or "Vote as Helpful" if you find it helpful.

    • Marked as answer by rockstar283 Wednesday, July 11, 2012 2:02 AM
    Wednesday, July 11, 2012 1:49 AM
  • Thank you for the heads up..

    This worked..

    Dim columnArray As String() = line.Split(CChar(vbTab))

    • Marked as answer by rockstar283 Wednesday, July 11, 2012 2:02 AM
    Wednesday, July 11, 2012 2:02 AM