+ Reply to Thread
Results 1 to 5 of 5

Parsing Characters

  1. #1
    Registered User
    Join Date
    08-27-2008
    Location
    Vancouver, BC
    Posts
    5

    Parsing Characters

    Hi,
    I'm sorry if the title isn't correct, I think that's what I'm trying to do is called...
    Anywho, I have some XML code that contains a bunch of data that I need to extract and place in another cell / sheet.

    The XML code will look something like this:

    Please Login or Register  to view this content.
    What I need to do is write a macro that can pull things like the account number out of here:
    Please Login or Register  to view this content.
    The numbers can be in different places throughout this code, and the code is rarely the same, but it follows the same patterns of placing these numbers between labels like that.

    I've got agents that have ot extract this information manually and it takes too much time.

    If anyone can point me in the right direction (and be a little patient with me :P) I'd really appreciate it.
    I hear and I forget. I see and I remember. I do and I understand.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    If that is all in A1 and "AccountNumber" (no quotes) is in B1 then
    =MID($A$1,FIND(">",A1&">",FIND(B1,A1&B1))+1,FIND("<",A1&"<",FIND(B1,A1&B1))-FIND(">",A1&">",FIND(B1,A1&B1))-1)

    will return the string "0001234567890123 "
    If you want the trailing space removed, use =TRIM(thatformula).
    If you want it as a number rather than a string =VALUE(thatformula)
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650
    Hi If data in Column "A"
    This will put the A/C Numbers in column "H"
    Please Login or Register  to view this content.
    Mick

  4. #4
    Registered User
    Join Date
    08-27-2008
    Location
    Vancouver, BC
    Posts
    5
    Thanks guys! I'll try them both out and post my results.

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    If they are in a column. Recording a macro that uses Text to Columns, first with delimiter "<" and don't import the first column,
    then another Text to Columns with delimiter ">" importing every column and YES, overwritting the cells.

    This will give the data format for a VLOOKUP.
    Last edited by mikerickson; 09-13-2008 at 04:09 PM.

+ 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. Remove control characters in the cells
    By ramsdesk in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-25-2012, 06:28 PM
  2. Delete last 9 characters from a cell
    By Tom K in forum Excel General
    Replies: 1
    Last Post: 03-05-2008, 02:10 PM
  3. Find the total amount of characters USED
    By jcc31 in forum Excel General
    Replies: 5
    Last Post: 10-15-2007, 11:37 AM
  4. Formual for number of Characters
    By Mike Weinberg in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-17-2007, 05:35 PM
  5. clean data - Removing Unwanted characters
    By theghost in forum Excel General
    Replies: 2
    Last Post: 02-25-2007, 02:48 PM

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