title: Appending txt data in pandas
body: <p>I'm trying to append data from a txt file that looks like this:</p>
  
  <pre><code>Kit Kat|2 packets |Candy| 6
  Flour|1 book|Book|2
  </code></pre>
  
  <p>I am trying to create a pandas DataFrame from this txt file with the column names: <strong>name, quantity, category, ID.</strong></p>
  
  <p>This is the code im currently using:</p>
  
  <pre><code>import pandas as pd
  
  df = pd.DataFrame(columns=['Name', 'Quantity', 'Category', 'ID'])
  
  file = open("food.txt", "r")
  
  for line in file:
     fields = line.split("|")
     product = df.append({'Name': fields[0]}, ignore_index=True)
     qty = df.append({'Quantity': fields[1]}, ignore_index=True)
     category= df.append({'Category': fields[2]}, ignore_index=True)
     ID = df.append({'ID': fields[3]}, ignore_index=True)
  
  df.head()
  </code></pre>
  
  <p>I am getting an empty dataframe as a result, anyone knows why?</p>