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. Import data from excel file to sqlite database using Qt C++
Forum Update on Monday, May 27th 2025

Import data from excel file to sqlite database using Qt C++

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 593 Views
  • 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.
  • S Offline
    S Offline
    Sini
    wrote on last edited by
    #1

    Hello,
    I have an excel file in my local storage which is of almost 2 MB. I want to create a relational database and want to import the data from the excel file to the database using C++.Is there any way to do this??Can anyone help me with this?

    JonBJ VRoninV 2 Replies Last reply
    0
    • S Sini

      Hello,
      I have an excel file in my local storage which is of almost 2 MB. I want to create a relational database and want to import the data from the excel file to the database using C++.Is there any way to do this??Can anyone help me with this?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Sini
      You need to start by knowing what the data in the Excel file and how you want to map it to a relational database. Or do you just mean every line in the Excel file is to map to a row in a single table in the database?

      S 1 Reply Last reply
      0
      • S Sini

        Hello,
        I have an excel file in my local storage which is of almost 2 MB. I want to create a relational database and want to import the data from the excel file to the database using C++.Is there any way to do this??Can anyone help me with this?

        VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by
        #3

        @Sini said in Import data from excel file to sqlite database using Qt C++:

        want to import the data from the excel file to the database using C++

        If it's a one-of then I'd advise against it. It's much easier and faster to just use excel to build your query strings and dump them in an editor.
        If it's a recurring thing then you can read excel files using one of the methods listed here and just use the QtSql module to get them into SQLITE

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        1
        • JonBJ JonB

          @Sini
          You need to start by knowing what the data in the Excel file and how you want to map it to a relational database. Or do you just mean every line in the Excel file is to map to a row in a single table in the database?

          S Offline
          S Offline
          Sini
          wrote on last edited by
          #4

          @JonB The file includes CAN signals and it has more than 60 columns and almost 5000 rows. I want to make multiple tables (two to three ) with foreign key reference since the file has many signal datas for a single id.

          JonBJ 1 Reply Last reply
          0
          • S Sini

            @JonB The file includes CAN signals and it has more than 60 columns and almost 5000 rows. I want to make multiple tables (two to three ) with foreign key reference since the file has many signal datas for a single id.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @Sini
            So I don't know what to say other than you'll need to write code to read/parse it and create tables, relationships and rows as required.

            1 Reply Last reply
            3

            • Login

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