+ Reply to Thread
Results 1 to 8 of 8

Parsing Irregular but well organized data

  1. #1
    Forum Contributor
    Join Date
    10-06-2013
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Excel 2010
    Posts
    208

    Parsing Irregular but well organized data

    Hi All,

    I have “irregular” but "well-organized” text in column “A” of the attached file. In each Cell of column “A”, includes a number of authors and their affiliated organizations participating in research projects. The authors and grouped by their organization along with the departments and full address and country.

    The data is organized in the following way

    In each cell of Column “A”, Names of authors are included within brackets “[ ]” and each Name is separated by a Semicolon “;”. In all cases, the full details of the affiliation including address and country are listed after the closing of the bracket "]".

    I would like, if possible a VBA, or other solution, that can parse the data on column “A” into the needed columns starting on Column “B”. Each column should contain the authors of the participating organization, i.e., parsing based on organization. Please note that some cells contains one organization as in Row 6 of the attached. In this case, just copy to B.

    The attached file contains partial list of the data (thousands of rows) and I think the attached is self explanatory. I manually parsed rows 1 to 6. The rest of the data to test the solution


    Many thanks in advance. Taisir
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,517

    Re: Parsing Irregular but well organized data

    This should do,
    Increase 10 if needed.
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Parsing Irregular but well organized data


    Hi,

    you can use the Data Convert assistant or see in VBA help TextToColumns method …

    ____________________________________________________________________
    Je suis Charlie

  4. #4
    Forum Contributor
    Join Date
    10-06-2013
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Excel 2010
    Posts
    208

    Re: Parsing Irregular but well organized data

    Many thanks Jindon for the prompt reply and the VBA. I just tested the VBA on the sample sheet and it worked fine. I will test in the big data set later today.

    Is your comment to "Increase 10" in case I have more that 10 organizations in the cell?


    Thanks

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,517

    Re: Parsing Irregular but well organized data

    Yes, that is correct.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Parsing Irregular but well organized data

    Here's a formula-based alternative (assumes data start in A2). Drag right and down as far as needed.

    =SUBSTITUTE(TRIM(MID(SUBSTITUTE($A2,"[",REPT(" ",1000)),(COLUMNS($A:B)-1)*1000+1,1000)),"]",";")
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Parsing Irregular but well organized data

    THis gets messy, but see how far you get with this? I used your sample from A2...
    B2=LEFT(A2,FIND("[",A2,2)-1)
    C2=MID($A2,FIND("#",SUBSTITUTE($A2,"[","#",COLUMN(B1)),1),IF(ISERROR(FIND("#",SUBSTITUTE($A2,"[","#",COLUMN(C1)),1)),FIND("#",SUBSTITUTE($A2,"[","#",COLUMN(B1)),1),FIND("#",SUBSTITUTE($A2,"[","#",COLUMN(C1)),1)-FIND("#",SUBSTITUTE($A2,"[","#",COLUMN(B1)),1)-1))
    copy C2 across
    then copy both down
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  8. #8
    Forum Contributor
    Join Date
    10-06-2013
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Excel 2010
    Posts
    208

    Re: Parsing Irregular but well organized data

    Dear Fdibbins and Glenn,
    Many thanks for the formulas and will test them along the VBA. I will keep you posted.

    I will go a head and mark the thread solved.

    This forum is great help.

+ 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. [SOLVED] Getting data from a huge table to a smaller and organized one.
    By Eldernurf in forum Excel General
    Replies: 4
    Last Post: 10-24-2013, 02:55 PM
  2. Parsing inconsistent text strings into columns in an organized manner
    By jagman1990 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-17-2010, 03:48 PM
  3. Numbers Organized As Data
    By campione in forum Excel General
    Replies: 0
    Last Post: 07-25-2006, 11:52 AM
  4. Using Excel's XML mapping/export with data organized in columns
    By DaveWhatmuff in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. Using Excel's XML mapping/export with data organized in columns
    By DaveWhatmuff in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 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