title: using while loop to read files
body: <p>I have 200 files, from which I wanna choose the second column. I wanna store the second column of each file in a list called &quot;colv&quot;. I wanna have colv[0]=[second column of the first file. colv[1] be the second column of the second file and so on.
  I write this code, but it does not work, in this code colv[0] is the first number of the second column of the first file. Can anyone help me how to fix this issue:</p>
  <pre><code>colv = []
  i = 1
  colvar = &quot;step7_1.colvar&quot;
  while os.path.isfile(colvar):
      with open(colvar, &quot;r&quot;) as f_in:
          line = next(f_in)
          for line in f_in:
              a = line.split()[1]
              colv.append(a)
      i+=1
      colvar = &quot;step7_%d.colvar&quot; %i
  </code></pre>