+ Reply to Thread
Results 1 to 8 of 8

How to Parse/extract specific info in a cell ?

  1. #1
    Registered User
    Join Date
    11-30-2010
    Location
    boston, ma
    MS-Off Ver
    Excel 2003
    Posts
    6

    How to Parse/extract specific info in a cell ?

    I have a logfile from a automated test, that contains time-stamped entry's when each test starts.

    The goal is to get the test name, and test timestamp into excel worksheet , so that I can then use excel to calculate the time each step is taking.

    From the text logfile, I "awk'd" on the significantportion of the logfile lines, looking for the lines containing :

    awk '/# <time/'

    and exported the result to another text file.

    I then pasted the text file into excel

    Now the excel file consists of cells , all of the format similar to this :

    # <time:17:15:40> ch8.1 CLOCK BITS clock verification #
    # <time:17:16:17> ch8.2 CLOCK T1/E1 framer clock verification #
    # <time:17:18:17> ch8.3 1588-FPGA,T1E1 framer,GE,SFP,10G phy recovery&GPS 10MHz clock verification #
    # <time:17:22:07> ch8.4 BITS Diagnostic Test #
    # <time:17:22:26> ch8.4 1PPS Diagnostic Test #
    # <time:17:22:40> ch10 Load JIT tests config #

    What I want to do from each of thoise cells is to extract into individual cells in columns to the right of each cell :
    1) the time - for example 17:15:40

    and then, less important, but good if possible :

    2) the test name - for example ch8.1 CLOCK BITS clock verification


    Any help appreciated !
    Last edited by HikerLT; 05-08-2012 at 10:33 AM. Reason: solved !

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: How to Parse/extract specific info in a cell ?

    do you have an example sheet? did you type exactly what is i the cells????
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: How to Parse/extract specific info in a cell ?

    If that is the exact entry, try this (in another column, would pull out the time part) -- i pasted what you had in the j column...

    =MID(J4,FIND(":",J4,1)+1,8)

    --edit---

    this brings back the 8 characters (timestamp) after the first encountered colon....

    To get the part 2:


    =MID(J4,FIND(">",J4,1)+2,LEN(J4)-FIND(">",J4,1)-2)

    Again, assuming that's exactly what you have
    Last edited by GeneralDisarray; 05-08-2012 at 10:27 AM.

  4. #4
    Registered User
    Join Date
    11-30-2010
    Location
    boston, ma
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: How to Parse/extract specific info in a cell ?

    PERFECT !!!


    Thanks SO MUCH...this saves me hours of work retyping the info

  5. #5
    Registered User
    Join Date
    11-30-2010
    Location
    boston, ma
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: [SOLVED] How to Parse/extract specific info in a cell ?

    OK,
    I have another file....slightly different information...and the parse/extract comes up with an error

    Here is the cell ( location B2) I am trying to extract the time information from:

    5/24/2013 17:00:03

    in the next cell C2 I have this formula, but it comes up as a "#value!" error

    =MID(B2,FIND("2013",B2,1)+1,8)



    I attached a small file with the info
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-17-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: [SOLVED] How to Parse/extract specific info in a cell ?

    =MID(B2,FIND("2013",year(B2),1)+1,8)

  7. #7
    Registered User
    Join Date
    11-30-2010
    Location
    boston, ma
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: [SOLVED] How to Parse/extract specific info in a cell ?

    Quote Originally Posted by jubiesxl View Post
    =MID(B2,FIND("2013",year(B2),1)+1,8)
    this is close, but isn't really providing the extracted "time" value hh:mm:ss

  8. #8
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: [SOLVED] How to Parse/extract specific info in a cell ?

    Just use formatting - this is a number (dates and times are stored as numbers in excel) and you are attempting to use Sting Handling to format how it is displayed

    See attachment. You can either just format the cell to display the number as hh:mm:ss (shown in column d) or you can use a formula which expects a number (shown in column E). It really depends on what you want to do with that column. If you use formatting, the full value is remembered but only the time part is shown. If you use the formula, the number is redfined (you lose the part left of the decimal point).



    Formula to get the Time part only =TEXT(B2,"HH:MM:SS")
    Attached Files Attached Files
    Last edited by GeneralDisarray; 06-11-2013 at 02:42 PM.

+ 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