Results 1 to 2 of 2

Thread: Problem to export .bin file to .txt file

  1. #1
    Join Date
    Jun 2018
    Qt products
    MacOS X Windows

    Default Problem to export .bin file to .txt file

    Hello everyone
    I am doing a program to acquire data from an NI-USB6008, the acquired data is saved in a .bin file and later the user can export them to a .txt file to open and process the data in Excel. I could save the data in .txt to not make the conversion, but for reasons of privacy among users of the program I am saving them in a .bin file. The problem I have is that the exporting file is not decoded or at least it is not done correctly. I have followed the recommended procedures in the Qt examples, but obviously there is something I am doing wrong. The problem is that I do not find the error. I would appreciate if someone tells me what my mistake is; so as not to take away much of your valuable time I have summarized the program, I add it below. Thanks averyone.
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2008
    Alameda, CA, USA
    Thanked 818 Times in 807 Posts
    Qt products
    Windows Android

    Default Re: Problem to export .bin file to .txt file

    QDataStream is for writing binary files, not text files. You need to open your target QFile with OpenMode "QIODevice:: WriteOnly | QIODevice:: Text" and then you need to use QTextStream to write the text file.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. The following user says thank you to d_stranz for this useful post:

    Eduardo Huerta (19th June 2018)

Similar Threads

  1. export my sql table to an excel file
    By achraf1194 in forum General Programming
    Replies: 1
    Last Post: 22nd October 2015, 14:10
  2. Replies: 2
    Last Post: 28th February 2014, 12:19
  3. Replies: 1
    Last Post: 4th March 2011, 08:34
  4. export file MySql to QtSql
    By pispipepe in forum Qt Programming
    Replies: 4
    Last Post: 21st December 2010, 02:19
  5. how to export data to a .CSV file
    By qtprgrmr in forum Qt Programming
    Replies: 1
    Last Post: 26th May 2010, 16:22

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.