+ Reply to Thread
Results 1 to 7 of 7

Need to parse text from a field where the placement of the text may change.

  1. #1
    Registered User
    Join Date
    05-24-2013
    Location
    Sacramento
    MS-Off Ver
    Excel 2007
    Posts
    4

    Need to parse text from a field where the placement of the text may change.

    I am trying to figure out a formula where I can pull out specific information from a text imported from Visual Studion 2005. Below is the information pulled from the database field and I need to pull out the "partNumber" and the "serialNumber".
    REGDATAOBJECT
    BeginGroup:database<?>currentFifos=0<?>maximumFifos=34369<?>maximumSpace=6291456<?>percentUsed=7<?>totalFixedSpace=123156<?>totalIndexSpace=77182<?>totalRowCount=2533<?>totalRowSpace=139024<?>totalTableSpace=339362<?>uncollectedFifos=0<?>usedSpace=478386<?>EndGroup:database<?>BeginGroup:network<?>DNS_ServerIP=None<?>DNS_DomainName=None<?>FTP_Enabled=false<?>EndGroup:network<?>BeginGroup:hardware<?>BeginGroup:biometrics<?>EndGroup:biometrics<?>BeginGroup:mSystem<?>format=7101<?>processorType=859<?>chipId=CF<?>EndGroup:mSystem<?>BeginGroup:barcodes<?>Barcode_attached=no<?>Symbologies=code3of9 i2of5 code128<?>Remote_Barcode_attached=no<?>EndGroup:barcodes<?>BeginGroup:board<?>revision=REV A<?>version=415<?>partNumber=98765431-123<?>serialNumber=CK123456<?>EndGroup:board<?>BeginGroup:magnetics<?>trackNum=no<?>EndGroup:magnetics<?>BeginGroup:memory<?>SDRAM=134217728<?>BeginGroup:flashDisks<?>flashDisk0=1018773504<?>flashDisk1=0<?>numOfFlashDisks=1<?>EndGroup:flashDisks<?>EndGroup:memory<?>BeginGroup:peripherals<?>modem=none<?>Wand_attached=no<?>EndGroup:peripherals<?>BeginGroup:keypad<?>Keypad_Type=Numeric<?>EndGroup:keypad<?>BeginGroup:proximityReaders<?>ProximityReader_attached=no<?>ProxReaderFormat1=Default 26 Bit Format<?>ProximityReader_NumRecords=2<?>RemoteProx_attached=no<?>RemoteProxFormat1=Default 26 Bit Format<?>RemoteProx_NumRecords=2<?>EndGroup:proximityReaders<?>EndGroup:hardware<?>BeginGroup:software<?>release=03.00.07.006 <?>HTMLClientVersion=5708<?>model=Kronos-4500<?>OSversion=5708<?>bootVersion=5708<?>appVersion=5708<?>dbSchema=5708<?>Font_Information=Default Latin fonts. <?>EndGroup:software<?>


    Thank You!!

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Need to parse text from a field where the placement of the text may change.

    That is all in one cell?

    Is each section (or at least the part number and serial number) followed by a < symbol?

    Try
    =MID(A1,1+SEARCH("partnumber",A1)+LEN("partnumber"),FIND("<",A1,SEARCH("partnumber",A1))-SEARCH("partnumber",A1)-LEN("partnumber")-1)

    and change all the partnumber strings to serialnumber

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

    Re: Need to parse text from a field where the placement of the text may change.

    Assuming the part number is always 12 digits:

    =MID(A2, SEARCH("PartNumber=", A2)+11, 12)


    Assuming the serial number is always 8 digits:

    =MID(A2, SEARCH("SerialNumber=", A2)+13, 8)



    EDIT:
    HAT-TIP to Jonmo1, yours is much better.
    _________________
    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!)

  4. #4
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: Need to parse text from a field where the placement of the text may change.

    for partNumber
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    For serialNumber
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Don't just use the answers provided for you. Try to understand how it works by reverse engineering or asking about it.

    Please mark the thread as [SOLVED] (Thread Tools->Mark thread as Solved) when answered.
    If you're happy with an answer given, please click the * under the person's name to boost their reputation.

  5. #5
    Registered User
    Join Date
    05-24-2013
    Location
    Sacramento
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Need to parse text from a field where the placement of the text may change.

    Yes a <? at the end of the partNumber and a > just before the partNumber (same with the serialNumber).

    Thanks

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

    Re: Need to parse text from a field where the placement of the text may change.

    If Jonmo1's formulas suffice, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need to parse text from a field where the placement of the text may change.

    Hi,

    Part Number
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Serial Number
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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. Replies: 0
    Last Post: 04-22-2013, 12:13 PM
  2. Macro to Parse Text - Import text to Excel from Multiple Text Files & Folders
    By Novice_To_Excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2012, 01:05 AM
  3. Parse out text in a mixed field
    By SueWithQuestion in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2012, 08:32 AM
  4. How to change field text based on dropdown selection.
    By Whizbang in forum Word Formatting & General
    Replies: 0
    Last Post: 01-25-2010, 02:48 PM
  5. Combobox text placement
    By Aussie_Striker in forum Excel General
    Replies: 1
    Last Post: 10-24-2006, 12:25 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