title: Node js - Remove string from text file
body: <p>How to i can remove string from text file ?</p>
  
  <pre><code>fs.readFile('./banlist.txt', function read(err, data) {
                  if (err) {
                      throw err;
                  }
                  lastIndex = function(){
                      for (var i = data_array.length - 1; i &gt; -1; i--) 
                      if (data_array[i].match(ip))
                          return i;
                  }()
                  delete data_array[lastIndex];
              });
  </code></pre>
  
  <p>But console give me message: data_array is not defined.
  I want to remove ip adress line.</p>