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. How to Swap Data Between txt File
Forum Updated to NodeBB v4.3 + New Features

How to Swap Data Between txt File

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 662 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.
  • R Offline
    R Offline
    Raminlich
    wrote on last edited by
    #1

    hi all
    i like to know is there any class for example do this:
    we have two txt file with names 1 , 2.

    1:
    hi
    yes

    2:
    goodbye
    no

    now in want swap this Data to be like this:
    1:
    goodbye
    no

    2:
    hi
    yes
    thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      No there's nothing pre-built for that. You'll have to open your files with QFile, parse their content e.g. to a QStringList, move things around, join back as a string and then overwrite the original data.

      There might be other solutions though

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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