+ Reply to Thread
Results 1 to 6 of 6

String of data needs to be set in columns

  1. #1
    Registered User
    Join Date
    10-16-2008
    Location
    bangalore
    Posts
    28

    String of data needs to be set in columns

    Hi,

    I have a stream of data say "02CN=FOR-NAVN,04COS=60,06PREPAID=no,05PWD=9869,05SN=LYSE ENERGI AS,09MSI1=089242010,05MSISDN=4747508762,01IMSI1=0892,01PROFILE=1,03IMSI1=089242010800061124"

    and i want the data in the excel in the form as:
    column 1 column 2 column 3
    02 CN FOR-NAVN
    04 COS 60
    06 PREPAID no
    05 PWD 9869
    MSISDN 4747508762

    similarly for others 09,01

  2. #2
    Registered User
    Join Date
    05-28-2008
    Posts
    13
    Hi Deepak

    Check if the following helps you

    Sub Split_String()

    Dim arTemp
    Dim s1
    Dim s2
    Dim s3
    Dim i1

    arTemp = Split("02CN=FOR-NAVN,04COS=60,06PREPAID=no,05PWD=9869,05SN=LYSE ENERGI AS,09MSI1=089242010,05MSISDN=4747508762,01IMSI1=0892,01PROFILE=1,03IMSI1=089242010800061124", ",")
    For i1 = 0 To UBound(arTemp)
    s1 = Left(arTemp(i1), 2)
    s2 = Mid(arTemp(i1), 3, InStr(1, arTemp(i1), "=") - 3)
    s2 = Mid(arTemp(i1), InStr(1, arTemp(i1), "=") + 1, Len(arTemp(i1)))
    Next i1
    End Sub

    Cheers
    Shasur

  3. #3
    Registered User
    Join Date
    10-16-2008
    Location
    bangalore
    Posts
    28

    the above suggested answer is not working

    The above suggested answer is not working i am getting absurd result.
    The data is splitting into only 2 rows and the last row is having all the records

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    There's no way to determine when to split the data. It might be clearer with an example workbook
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    05-28-2008
    Posts
    13
    Quote Originally Posted by deepak.kec View Post
    The above suggested answer is not working i am getting absurd result.
    The data is splitting into only 2 rows and the last row is having all the records

    Deepak

    The code is NOT the solution.

    That is one of the way to address the problem

    Cheers
    Shasur

  6. #6
    Registered User
    Join Date
    05-28-2008
    Posts
    13
    Quote Originally Posted by deepak.kec View Post
    The above suggested answer is not working i am getting absurd result.
    The data is splitting into only 2 rows and the last row is having all the records

    Deepak

    The code is NOT the solution. It works fine for the snippet

    That is one of the way to address the problem. Modify the code accordingly for your file

    Cheers
    Shasur

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copying Filtered Data Columns to new spreadsheet
    By GuruWannaB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2008, 05:29 PM
  2. Move data in rows to columns
    By hfler in forum Excel General
    Replies: 2
    Last Post: 07-14-2008, 12:32 PM
  3. Replies: 1
    Last Post: 03-10-2008, 04:32 PM
  4. Can you hide cells but keep data? Or reverse columns?
    By Ohucan2 in forum Excel General
    Replies: 3
    Last Post: 04-09-2007, 07:58 AM
  5. Many Ols Regressions on Many Columns of Data
    By Carpenter9 in forum Excel General
    Replies: 0
    Last Post: 09-12-2006, 02:32 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1