title: how to read more than one word between double quotes from a file in C
body: <p>i'm trying to read strings from a file and into a struct but when i reach strings with two or more words everything i seem to try does not work </p>
  
  <p>data in file </p>
  
  <p>"K300" "Keyboard" "US Generic" 150.00  50</p>
  
  <p>"R576" "16-inch Rims" "Toyota Verossa" 800.00   48</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  typedef struct partInfo {
    char number[6];
    char name[20];
    char description[30];
    double price;
    int qty;
  }Part;
  
  int main() {
  
  char num[6], name[20], desc[30];
  int i=0;
  int q;
  double p;
  char ch;
  
  
  FILE * in = fopen("input.txt", "r");
  
  Part part1;
  fscanf(in, " %[^ ]s", &amp;num);
  printf("%s\n", num);
  
  fscanf(in, " %[^ ]s", &amp;name);
  printf("%s\n", name);
  
  fscanf(in, " %[^ ]s", &amp;desc); //right here only copy "US and not the Generic"
  printf("%s\n", desc);
  
  strcpy(part1.number, num);
  strcpy(part1.name, name);
  strcpy(part1.description, desc);
  
  fclose(in);
  return 0;
  }
  </code></pre>
  
  <p>however when i try to use </p>
  
  <pre><code> fscanf(in, " %[^\n]s", &amp;desc); 
  </code></pre>
  
  <p>it copies the rest of the line
  i've been stuck on this for two days can someone please help me
  and also how to get rid of the double quotes if that is possible
  i tried a different set of code for that and more errors arise :(</p>