title: Reading in data from a string in C (like scanf)
body: <p>I've read in and stored a data file that I am processing into an array of char arrays, one char array for each line in the file and I now want to process the individual lines. I'm not however sure how to do this.</p>
  
  <p>I read each line in like so:</p>
  
  <pre><code>/* Read the whole file into an array */
  char read_lines[FILE_LENGTH][FILE_WIDTH];
  for(i=0;i&lt;FILE_LENGTH;i++) {
      fscanf(data_file, "%[^\n]", read_lines[i]);
      fscanf(data_file, "%[\n]", dump);
  }
  </code></pre>
  
  <p>I need to read the data in each line which is formatted as %d\t%d\t%d\t%d\t%d and I'm not really sure how to read a specific variable into a scanf function. I know that fscanf() reads from a file and scanf() reads from user input, is there a function that reads from a variable?</p>
  
  <p>I come from a python background and in python, I would just use the following code:</p>
  
  <pre><code>read_lines = open('file.txt').readlines()
  for line in lines:
      i = lines.index(line)
      first[i], second[i], third[i], forth[i], fifth[i] = line.split('\t')
  </code></pre>
  
  <p>I really cannot see how to do the equivalent in C. I've done a fair bit of research but I couldn't find anything useful. Any help would be appreciated!</p>
  
  <p>Thanks!</p>