title: How to delete all lines containing certain keywords in a txt file with python
body: <p>How to delete all lines containing certain keywords in a txt file with python.</p>
  <p>I have a txt file with 10000’s of data. I want to delete any line containing &quot;2021–07-13&quot;</p>
  <p>The data is represented like this (this is just an example, the data it self has thousands of the same date data):</p>
  <pre><code>{“date”:”2021-08-13T15:13:49.752Z”, ”value”:”184478”}
  {“date”:”2021-08-13T15:13:49.752Z”, ”value”:”128478”}
  {“date”:”2021-08-13T15:13:49.752Z”, ”value”:”183478”}
  {“date”:”2021-08-13T15:13:49.752Z”, ”value”:”188478”}
  {“date”:”2021-08-13T15:13:49.752Z”, ”value”:”188478”}
  {“date”:”2021–07-13T15:13:49.752Z”, ”value”:”18658”}
  {“date”:”2021-07-13T15:13:49.752Z”, ”value”:”184478”}
  {“date”:”2021-07-13T15:13:49.752Z”, ”value”:”128478”}
  {“date”:”2021-06-13T15:13:49.752Z”, ”value”:”183478”}
  {“date”:”2021-06-13T15:13:49.752Z”, ”value”:”188478”}
  {“date”:”2021-05-13T15:13:49.752Z”, ”value”:”188478”}
  {“date”:”2021–0513T15:13:49.752Z”, ”value”:”18658”}
  </code></pre>