Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Parsing text with separated scheme-file

Parsing text with separated scheme-file

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 761 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    broinel
    wrote on last edited by
    #1

    Hi comunity!

    I'm facing the following problem for which i'm looking for some hints. I'm a bit stucked and don't get the idea how to solve the problem...

    • I have a text file (input-file). This file is formated according a certain scheme. The scheme will change in the futur!
    • i want to read that text file into my program, edit it and write a new text-file with the same scheme.

    I thought i will use XML (or XSD?) to define the scheme. Whenever the schemes would change, a new XML-File needs to be created.
    So that i don't have to change the source code.

    Example:
    testtextfile.txt

    @Miller

    3 PERSONS
    1 Hugo 46 1.80
    2 Marie 42 1.60
    3 Baby 2 0.4@

    And then the XML-Template-File would look like

    @<Family>
    <FamilyName>
    <NumberOfMembers>PERSONS
    <Person>
    <ReferenceNumber/>
    <Name/>
    <Age/>
    <Height/>
    </Person>
    </Family>@

    I think i'm able to write a correct XML or XSD Template file, but is that the correct way to face the problem?
    When the scheme changes the user will have to adapt the template so my program still understands his input files.

    Thanks for any help!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved