+ Reply to Thread
Results 1 to 9 of 9

Turning a huge text list into an organized excel sheet - rowls, columns, ect.

  1. #1
    Registered User
    Join Date
    02-14-2012
    Location
    Washington, DC
    MS-Off Ver
    Excel 2003
    Posts
    4

    Turning a huge text list into an organized excel sheet - rowls, columns, ect.

    I'm trying to turn an enormous contact list from a text/word/pdf format into a usable excel sheet. I'm having a big problem because what I need is something like conditionally transposed pasting... Not even sure where to start. Someone tell me if this is hopeless, because doing it manually will take so long that I'm going to have to keep trying till someone solves this or tells me to give up.

    Basically I have a sheet that's:

    Org name
    Street Address
    City, State Zip
    (area) Phone-Number

    and instead I need (humor me that "/" is a new cell column):

    Org name / Address / City, State Zip / (area) Phone-Number

    And then it gets even a little bit more complicated because there are randomly categories inserted occasionally categories before an org is listed, so sometimes it's:

    Region 5
    Org name
    Street Address
    City, State Zip
    (area) Phone-Number

    Uggg.

    If it helps anything, I work at a health non-profit. We do good work, but could really use your help on this...

  2. #2
    Forum Contributor
    Join Date
    02-08-2012
    Location
    South Suffolk
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: Turning a huge text list into an organized excel sheet - rowls, columns, ect.

    There are lots of ways of tackling this and I have done similar things many times. To help identify the best way, approximately how many lines of text are there?
    The additional category identification will be a problem and there needs to be a set of rules to identify what is a caregory and how to distinguish it from the following organisation. If it always starts "Region" and no organisation is so named it will be easier!

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Turning a huge text list into an organized excel sheet - rowls, columns, ect.

    PatrickM,

    Welcome to the forum!
    Can you upload a sample of the text file so we can get a better idea of what it looks like and how to work with it? Just be sure to scrub sensitive data, or use mock data in the same format and layout.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    02-14-2012
    Location
    Washington, DC
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Turning a huge text list into an organized excel sheet - rowls, columns, ect.

    Thanks for the quick replies. Our office internet dropped off, but it's back up (whew).

    Here's a sample of data, I picked a few clinics that I thought wouldn't mind, but changed all their phone numbers to (888) 888-8888.

    The category structure is Region->State->Type. There are 10 regions, about 4 types, and of course there are something like 55 state and US territories.
    When I copy the data straight into excel, each line becomes 1 cell, all in one column. There are something like 24,000 cells to start out, so doing this manually would probably kill me.

    One last note: while each clinic usually is 4 cells of data, occasionally there's an extra line for P.O. boxes. I don't need that data, but I point it out because the number of cells that should become each row of data isn't always the exact same.

    Ok, here's a sample of my data...

    REGION I
    CONNECTICUT
    GRANTEE(S)
    FAIR HAVEN COMMUNITY HEALTH CENTER
    374 GRAND AVENUE
    NEW HAVEN, CT 06513
    (888) 888-8888
    CLINIC(S)
    FAIR HAVEN COMMUNITY HEALTH CENTER FAMILY PLANNING CLINIC
    374 GRAND AVENUE
    NEW HAVEN, CT 06513
    (888) 888-8888
    SCHOOL BASED HEALTH CENTER FAIR HAVEN MIDDLE SCHOOL
    164 GRAND AVENUE
    NEW HAVEN, CT 06513
    (888) 888-8888
    DELEGATE(S)
    HARTFORD PUBLIC SCHOOLS STUDENT HEALTH CENTERS
    960 MAIN STREET
    HARTFORD, CT 06103
    (888) 888-8888
    CLINIC(S)
    FOX MIDDLE SCHOOL STUDENT HEALTH CENTER
    305 GREENFIELD STREET
    HARTFORD, CT 06112
    (888) 888-8888
    QUIRK MIDDLE SCHOOL STUDENT HEALTH CENTER
    85 EDWARDS STREET
    HARTFORD, CT 06120
    (888) 888-8888
    DELEGATE(S)
    WINDHAM HIGH SBHC
    355 HIGH STREET
    WILLIMANTIC, CT 06226
    (888) 888-8888
    CLINIC(S)
    WINDHAM HIGH SBHC
    355 HIGH STREET
    WILLIMANTIC, CT 06226
    (860) 465-2465
    WINDHAM MIDDLE SCHOOL WELLNESS CENTER
    123 QUARRRY STREET
    WILLIMANTIC, CT 06226
    (860) 465-2465

    MAINE
    GRANTEE(S)
    FAMILY PLANNING ASSOC. OF MAINE
    43 GABRIEL DRIVE
    AUGUSTA, ME 04330
    (207) 622-7524
    DELEGATE(S)
    ACAPHS
    169 ACADEMY STREET
    PRESQUE ISLE, ME 04769
    (207) 768-3056

  5. #5
    Registered User
    Join Date
    02-14-2012
    Location
    Washington, DC
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Turning a huge text list into an organized excel sheet - rowls, columns, ect.

    Hey, my office shuts down at 6pm (10 minutes ago) and I've pushed it about as far as I can. I REALLY appreciate the help, and A, be back on this tomorrow morning, and B) following it from my phone tonight if anything posts. But I won't be able to post anything else at length till the morning.

    AndyPS and tigeravatar, thank you so much for taking an interest in this!

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Turning a huge text list into an organized excel sheet - rowls, columns, ect.

    PatrickM,

    So, just to be clear, using the data you provided, the output should look like the following, is that correct?


    Org Name Street Address City, State Zip (area) Phone-Number
    FAIR HAVEN COMMUNITY HEALTH CENTER 374 GRAND AVENUE NEW HAVEN, CT 06513 (888) 888-8888
    FAIR HAVEN COMMUNITY HEALTH CENTER FAMILY PLANNING CLINIC 374 GRAND AVENUE NEW HAVEN, CT 06513 (888) 888-8888
    SCHOOL BASED HEALTH CENTER FAIR HAVEN MIDDLE SCHOOL 164 GRAND AVENUE NEW HAVEN, CT 06513 (888) 888-8888
    HARTFORD PUBLIC SCHOOLS STUDENT HEALTH CENTERS 960 MAIN STREET HARTFORD, CT 06103 (888) 888-8888
    FOX MIDDLE SCHOOL STUDENT HEALTH CENTER 305 GREENFIELD STREET HARTFORD, CT 06112 (888) 888-8888
    QUIRK MIDDLE SCHOOL STUDENT HEALTH CENTER 85 EDWARDS STREET HARTFORD, CT 06120 (888) 888-8888
    WINDHAM HIGH SBHC 355 HIGH STREET WILLIMANTIC, CT 06226 (888) 888-8888
    WINDHAM HIGH SBHC 355 HIGH STREET WILLIMANTIC, CT 06226 (860) 465-2465
    WINDHAM MIDDLE SCHOOL WELLNESS CENTER 123 QUARRRY STREET WILLIMANTIC, CT 06226 (860) 465-2465
    FAMILY PLANNING ASSOC. OF MAINE 43 GABRIEL DRIVE AUGUSTA, ME 04330 (207) 622-7524
    ACAPHS 169 ACADEMY STREET PRESQUE ISLE, ME 04769 (207) 768-3056

  7. #7
    Registered User
    Join Date
    02-14-2012
    Location
    Washington, DC
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Turning a huge text list into an organized excel sheet - rowls, columns, ect.

    Yes! That is it exactly. Thanks.

  8. #8
    Forum Contributor
    Join Date
    02-08-2012
    Location
    South Suffolk
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: Turning a huge text list into an organized excel sheet - rowls, columns, ect.

    I think the main problem is going to be spotting the change from one record to another. Does the phone number -e.g. (888) 123-1234 - always come in the last line of the data list item? If so, is it of the same form?
    Also, is this a once-off job? If so a small amount of manual manipulation is not too much of an overhead.
    I would be quite tempted to do some data cleansing by
    1. firstly importing the list into the first column of the worksheet (c. 24,000 rows)
    2. next put numbers from 1 to 24,000 (equal to the row number) in an adjacent column
    3. sort the two columns (the numbers preserve the original position)
    4. find and delete the rows with words like 'Region' and the type (Grantee, Clinic)
    5. if possible, delete the 'State' rows
    6. sort the remaining rows back into the original number order
    I have suggested this process as the human eye is very good at spotting the bits of heading you don't want but it can be quite defficult to define precisely all the rows to be discarded!
    Unfortunately I haven't got time now to produce some code but will have a think about it and come back to you (if someone else hasn't get there first!).

  9. #9
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Turning a huge text list into an organized excel sheet - rowls, columns, ect.

    PatrickM,

    Sorry for the delayed response. Attached is a test text file that contains the test data you provided. Also attached is an example workbook that can be used to import the text file information in the desired format. The 'Import Text File' button is mapped to this macro:
    Please Login or Register  to view this content.


    Just in case you are new to macros:
    How to use a macro:
    1. Make a copy of the workbook the macro will be run on
      • Always run new code on a workbook copy, just in case the code doesn't run smoothly
      • This is especially true of any code that deletes anything
    2. In the copied workbook, press ALT+F11 to open the Visual Basic Editor
    3. Insert | Module
    4. Copy the provided code and paste into the module
    5. Close the Visual Basic Editor
    6. In Excel, press ALT+F8 to bring up the list of available macros to run
    7. Double-click the desired macro (I named this one tgr)
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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