title: How can I use a text file as database in Python?
body: <p>I want to know what is the efficient way to insert several data to text file as database logic?</p>
  
  <p>For instance I have set of cars, these cars have their <code>id, name</code>, and <code>color</code> variable.</p>
  
  <pre><code>id | name | color
  1  | car1 | green
  2  | car2 | red
  3  | car3 | blue
  </code></pre>
  
  <p>I want to insert the data above to text file using python. </p>
  
  <p>Later on I want to search a car, for instance based on its color.</p>
  
  <p>Which method should I follow? An example with an explanation will really be appreciated!</p>