Forum Discussion

aamer_iqbal's avatar
aamer_iqbal
Occasional Contributor
12 years ago

How to read tab separated string??

I want to read text separated by "TAB".



e.g : 

I want to read below text from text file and save 1,2,3,4 and 5 in different variables. How can I do it ?

ABCD(1)    EFGH(2)    IJKL(3)    MNOP(4)    QRST(5)



Kindly help for the same.



Thanks 

Aamer Iqbal

3 Replies

  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 1 rankChampion Level 1
    Hi Aamer,



    One of the possible approaches: split() function will return an array that can be used later.

    In VBScript it will be:

    Dim arr

    arr = split(strDataString, vbTab)



    In JScript it will be something like this:

    var arr = split(strDataString, '\t');
  • Hi Aamer ,



    I am using below function for seperating string by "="



    sString.split("=");



    Try Exploring this function .



    Thanks .