title: Import multiple files using paths stored in variables into SQLite tables in C
body: <p>I have the following code:</p>
  
  <pre><code>char const* const fileName = argv[1]; 
  FILE* file = fopen("/home/tariq/Desktop/domainlist.txt", "r"); 
    char path[256] ;
    char subpath[128];
  
    while (fgets(path, sizeof(path), file)) {
          if (fscanf(file,"%s" ,path)==1){
              memcpy(subpath, &amp;path[23], 30);
              subpath[strlen(subpath)-8] = '\0';
            printf("Path %s ***** SubPath %s\n", path, subpath);
  
          }
    }
  </code></pre>
  
  <p>As you can see, the while loops on the domainlist.txt file (which contains a list of other text files). in the variable path I store each path from the domainlist.txt and in the variable subpath I store some text from the original path. My question is that I want (instead of the printf line) to create SQLite table with a name from variable the subpath and import the data from the file in variable path.
  The SQLite database is already created and a connection is open, I just want to create tables and import data into them. I tried to use termsql but all I could do is to create separate database from each file, which I don't want, I want one DB but different tables.</p>
  
  <p>I hope I could describe my case correctly.</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The content of the files to be added to the db tables are just a list of URLs. Example below:</p>
  
  <p>the file (domainlist.txt) contains a list of paths,</p>
  
  <p>Example of a path:
  Path (which will be in the path variable):
  /home/tariq/Desktop/BL/ads/domains.txt</p>
  
  <p>Subpath variable (which I want to be the table name):
  ads</p>
  
  <p>Content of file "domains.txt" in the path above is just a list of URLs.</p>