title: Getting: index out of list error when trying to read text file
body: <p>I am trying to extract all the float elements from dataset into three columns using Python. But I get an index out of range error.</p>
  
  <pre><code>#Reading the file line by line, separating each line by columns
  
  file1=open("./Marine/bath.txt","r") 
  x=[]                                  
  y=[]
  z=[]
  i=1
  for line in file1:   ### Reading sequencially the lines of the file1 object
      if i&gt;4:
          columns=line.split()
          x.append(float(columns[3]))
          y.append(float(columns[1]))
          z.append(float(columns[5]))
      i=i+1
  
  file1.close()
  
  x=np.array(x)
  y=np.array(y)
  z=np.array(z)
  
  
  print("Number of lines read                :",i-1)
  print("Number of samples read from the file:",len(x))
  </code></pre>
  
  <p>Data looks like this:</p>
  
  <pre><code>zzzzzzz   50.0 ttttttt   329365.108 bbbbbbbb  4358562.104
  zzzzzzz   220.00000000000003 ttttttt   402708.003 bbbbbbbb  4344547.635
  zzzzzzz   110.00000000000001 ttttttt   347930.603 bbbbbbbb  4233132.610
  </code></pre>
  
  <p>with zzzzzzz   as the start of each line</p>