+ Reply to Thread
Results 1 to 8 of 8

"convert" data with logfile structure to spreadsheet structure

  1. #1
    Registered User
    Join Date
    08-31-2009
    Location
    boarders' paradise
    MS-Off Ver
    Excel 2002
    Posts
    94

    "convert" data with logfile structure to spreadsheet structure

    Hi folks.

    This must be one of the top 10 classic Excel problems:
    How to automate the import of non-table-data into an Excel table?

    I have a logfile listing my mobile phone's calls and SMS. Each entry is separated with a "----------" line.

    Please Login or Register  to view this content.

    Now what I want to do is import all the data into a table.
    The result should look like the attached image.

    What must I do?
    Thank you so much.
    Attached Images Attached Images
    Last edited by boarders paradise; 01-04-2011 at 03:26 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: "convert" data with logfile structure to spreadsheet structure

    Try this:

    Please Login or Register  to view this content.

    Edit the InitialFilename string to the path where your files are most likely to be.

    Also, I set the filter to text files, you can edit that to whatever extension your data file usually has.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    08-31-2009
    Location
    boarders' paradise
    MS-Off Ver
    Excel 2002
    Posts
    94

    Re: "convert" data with logfile structure to spreadsheet structure

    Thank you so much, JBeaucaire!
    OMG, I just can't believe that you actually wrote some code just for my problem!!

    I am incredibly thankful and will try this out in a moment and will post the results.

    But does this mean, that the only way this can be done is in a programming language? I cannot resort to standard Excel manipulations somehow?

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: "convert" data with logfile structure to spreadsheet structure

    like this with functions
    i havent bothered to hide #VALUE! but it is easily done if required
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: "convert" data with logfile structure to spreadsheet structure

    My macro is actually creating the table for you using worksheet functions, I just put the formula into a macro.

    This is the formula I put in B2 and copy down and across as far as needed, then I remove the formulas and flatten the values:

    =SUBSTITUTE(INDEX($A:$A, ((ROW(A1)-1)*15)+COLUMN(B1)),B$1&"=","")

    Try that...just put your data in column A, then that formula in column B starting at B2, then copy the cell...the rest of the data reformats.

    Lastly, the macro version just deletes the column A raw data.

  6. #6
    Registered User
    Join Date
    08-31-2009
    Location
    boarders' paradise
    MS-Off Ver
    Excel 2002
    Posts
    94

    Re: "convert" data with logfile structure to spreadsheet structure

    thank you! I gave rep points to both of you.

    It will take me a bit to familiarize myself with the concepts, but I will definitely give feedback here once I have figured it out. Thank you so much.
    Last edited by boarders paradise; 01-10-2011 at 04:01 AM.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: "convert" data with logfile structure to spreadsheet structure

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  8. #8
    Registered User
    Join Date
    08-31-2009
    Location
    boarders' paradise
    MS-Off Ver
    Excel 2002
    Posts
    94

    Re: "convert" data with logfile structure to spreadsheet structure

    thank you JBeaucaire and martindwilson.
    you really had clever ideas. As far as I can see this does exactly what I need.
    I always mark as "solved".
    Just give me a little time to look through your instructions and help.
    Thank you.

    (EDIT: deleted some confused stuff I wrote before putting my specs on :-)
    Last edited by boarders paradise; 01-10-2011 at 02:13 AM.

+ 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