+ Reply to Thread
Results 1 to 2 of 2

Parsing XML from text file

  1. #1
    Registered User
    Join Date
    03-31-2012
    Location
    Nottingham
    MS-Off Ver
    Excel 2003
    Posts
    15

    Parsing XML from text file

    Hi,

    I have exported some windows event logs which has created a text file. This is a mixture of text and XML.
    I am looking for a way to go through the text file and extract the XML whilst ignoring the plain text. I would then like to take each line of XML data and place it into a a row of its own. Essentially creating a new row for each event within the log.

    I have attached the event log output and also a spreadsheet that shows how I would like it to look. I've done this manually, but I want to export around 100 logs and can't go through it manually for that many.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    7,258

    Re: Parsing XML from text file

    Hi !

    What a weird file format !

    Anyway, at beginner level :

    • Read each line from text file using Line Input # statement,
    to see in VBA inner help and its sample showing how to read a text file …

    • Use Like operator to check each line.

    • Extract data via VBA basics text functions like Split or Instr & Mid

+ 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. Parsing text file
    By handerson0603 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-06-2014, 12:14 PM
  2. Parsing text file into excel
    By Lisa4legin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-24-2012, 10:37 PM
  3. Parsing text file for input to workbook
    By gcoug in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-22-2011, 12:44 PM
  4. Parsing Text file to Excel
    By fareen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2011, 02:11 PM
  5. Parsing data from text file
    By grumps in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2009, 05:59 AM
  6. Parsing text file to Excel (VBA)
    By mixmaster in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2007, 03:18 AM
  7. [SOLVED] Parsing a Text File
    By rstroughair@googlemail.com in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-30-2006, 12:45 PM
  8. Issue with parsing text file into worksheet
    By primrose in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-25-2005, 12:09 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