title: How to read large text file in c
body: <p>I'm trying to use linked list to store every line of one big file (from 1 GB to 70 GB), but that's the problem, I can't because it overflows my RAM and forces windows to stop the program execution.</p>
  
  <p>The function I wrote are these:</p>
  
  <pre><code>struct Word {
      char word[13];
  };
  
  typedef struct Nodo {
      struct Word word;
      struct Nodo *next;
  } TNodo;
  
  typedef TNodo *Nodo;
  
  void NewWord(Nodo *p, struct Word s) {
      Nodo temp;
      temp = (Nodo)malloc(sizeof(TNodo));
      temp-&gt;word = s;
      temp-&gt;next = *p;
      *p = temp;
  }
  
  void LoadList(Nodo *p) {
      FILE *f;
      struct Word s;
      char *buffer = malloc(sizeof(struct Word));
  
      if (!(f= fopen("wordlist.txt", "r"))) {
          fclose(f);
          exit(1);
      }
  
      while (fgets(buffer, sizeof(struct Word), f)) {
          if (sscanf(buffer,"%s", s.word) == 1) {
               NewWord(p, s);
          }
      }
      fclose(f);
      free(buffer);
  }
  </code></pre>
  
  <p>Is there a better way to process data (like deleting lines of file) from very large text files without storing them? </p>
  
  <p>the text file I'm trying to read has this simple structure:</p>
  
  <pre><code>Word
  Worf
  Worg
  </code></pre>