split function in vb 6.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vivekgrs
    New Member
    • Mar 2006
    • 11

    split function in vb 6.0

    hi
    in vb 6.0 ,iam using space in split function. that is working fine.

    Split(str, " ")

    now i want 2 use tab. bcoz in the text file the delimiter they are using is tab. so i want 2 use tab for split funcion. i dont know abut that . can anyone help me .

    2 4 6 7 -- like this the data is available.

    regards

    vivek
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Originally posted by vivekgrs
    hi
    in vb 6.0 ,iam using space in split function. that is working fine.

    Split(str, " ")

    now i want 2 use tab. bcoz in the text file the delimiter they are using is tab. so i want 2 use tab for split funcion. i dont know abut that . can anyone help me .

    2 4 6 7 -- like this the data is available.

    regards

    vivek
    Hi, you will need to consider the tab as a number of spaces e.g. 4 spaces and use the split function like that Split(str, " ")

    Comment

    • Andrew Thackray
      New Member
      • Oct 2006
      • 76

      #3
      try

      Code:
      Split(str,chr(9))
      ascii chr 9 is the tabl character.

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by Andrew Thackray
        try
        Code:
        Split(str,[b]chr(9)[/b])
        ascii chr 9 is the tabl character.
        You can also use the constant vbTab - it provides the same value, and doesn't require you to execute the Chr() function all the time. In other words...
        Code:
        Split(str,vbTab)

        Comment

        • vivekgrs
          New Member
          • Mar 2006
          • 11

          #5
          hi
          thanks for the valuable information from urs. it helped me alot.

          regards
          vivek

          Comment

          Working...