title: python - read csv file from last line
body: <p>I searched quite a bit, but I could not find a way to read the data from a csv file from a particular line number.</p>
  
  <p>The csv file gets updated on the fly. To be more precise the delimiter is a tab space
  so, at time t1:</p>
  
  <pre><code>1 2 3
  5 6 7
  8 9 10
  11 12 13
  14 15 16
  </code></pre>
  
  <p>at time t2 it is </p>
  
  <pre><code>1 2 3
  5 6 7
  8 9 10
  11 12 13
  14 15 16
  17 18 19
  </code></pre>
  
  <p>I have a collection(deque) in which I want to append the data from coloumn0 the csv file.</p>
  
  <p>at the moment the code I have written is able to do this:
  at time 0:</p>
  
  <pre><code>[deque([0, 0, 0, 0, 0], maxlen=5)]
  </code></pre>
  
  <p>at time 1:</p>
  
  <pre><code>[deque(['1', '5', '8', '11', '14'])]
  </code></pre>
  
  <p>at time 2:</p>
  
  <pre><code>[deque(['5', '8', '11', '14','17'])]
  </code></pre>
  
  <p>The code i've scripted is reading it in the format I want. </p>
  
  <pre><code>Question:
  </code></pre>
  
  <p>but when I reopen the file again at some point 'x'. it should read from  </p>
  
  <pre><code>[deque(['8', '11', '14','17','x'])]
  </code></pre>
  
  <p>and not </p>
  
  <pre><code>[deque(['1', '5', '8', '11', '14'])]
  </code></pre>
  
  <p>and is it possible for me to read one line and jump to the next file? is there a library that will allow me to do this?</p>
  
  <p>am I clear? or am I missing out to give some information?</p>
  
  <p>Updating the answer to this question by taking the input from kurtis(all credits to him):</p>
  
  <pre><code>perf_his = []
  
  for a in range(len(filename)):
   perf_his += [deque([0]*5,maxlen=5)]
  for a in range(len(filename)):
   lines = open(filename[a]).readlines()[-NUM_LINES:]
   mydata = [line.split()[0] for line in lines]
   for i in range(0, len(mydata)):
    perf_his[a].append(mydata[i])
     print perf_his
  </code></pre>