title: Read tab delimited file to Structure in C
body: <p>I have a file with tab delimited data. I want to read the every line into a Structure. I have a code to read the data to char buffer. But I want to load the data into a Structure.</p>
  <p>This is My sample data.</p>
  <blockquote>
  <p>empname1\t001\t35\tcity1</p>
  <p>empname2\t002\t35\tcity2</p>
  </blockquote>
  <p>My Structure definition .</p>
  <pre><code>struct employee
  {
    char *empname;
    char *empid;
    int age;
    char *addr;
  
  };
  </code></pre>
  <p>My sample program to read data to a <code>char</code> array <code>buffer</code></p>
  <pre><code>char buffer[BUF_SIZE];      /* Character buffer */
      input_fd = open (fSource, O_RDONLY);
      if (input_fd == -1) {
         perror (&quot;open&quot;);
          return 2;
      }
                      
      while((ret_in = read (input_fd, &amp;buffer, BUF_SIZE)) &gt; 0){
                      
           // Do Some Process 
      }
  </code></pre>
  <p>Here I want to load the content to a structure variable instead of the character buffer. How I can achieve that?</p>