CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2003
    Location
    Holland
    Posts
    146

    Save from .xml to .txt

    I have a xml-file (attached).
    From this file I want to read all the content from '<InkomstenverhoudingInitieel> which appears 1 or more times in that file,
    and then I want sa save these child items to a .txt file.
    Can that be done or do I need Treeview?
    I am not know with xml.
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2016
    Posts
    14

    Re: Save from .xml to .txt

    The XML file is actually a Text file, but with the file type .XML
    Each line in the XML file is a string
    If you use the "lineInput" instruction to read each line, you can pass the contents of each line to a string.
    Then check the string with the "instr" command to see if the tag <InkomstenverhoudingInitieel> exists in the string.
    Use the "mid" instruction to extract the variable asociated with the tag.
    Then use the "PRINT #n" instruction to output the variable to the text file which will contain all the values you are looking for.

    You dont need a treeview or anything fancy - just a few text string processing commands

  3. #3
    Join Date
    Jul 2017
    Posts
    14

    Re: Save from .xml to .txt

    Thanks for this answer! It helped me aswell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured