title: Hot skip special character in txt file python
body: <p>I have some issues while reading txt files. What i have to do is read files ( about 360 ) and make a plot. Everything works except when there is a special character in my file such us: "". When my reading function finds that character it crashes. Is there any way to skip it? My code:</p>
  
  <pre><code>import os
  import matplotlib.pyplot as plt
  import numpy as np
  
  i = 10
  j = 0
  X = []
  Y = []
  Z = []
  k = 0
  A = np.zeros([360,719])
  
  for i in range(10,360,10):
          X = []
          Y = []
          if len(str(i)) == 2:
              data = open(dir + '\\150317_ScPONd_0%s_radio.txt'%i, 'r')
          else:
              data = open(dir + '\\150317_ScPONd_%s_radio.txt'%i, 'r')
          z = data.readlines()
          data.close()
          for line in z:
              if not line.startswith('$'):
                  data_2 = line.split('\t')
                  X.append(data_2[0])
                  Y.append(data_2[1])
          A[j,:] = X
          A[(j+1),:] = Y
  </code></pre>
  
  <p>And here is how my file looks like:
  <a href="https://i.stack.imgur.com/aCS8w.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aCS8w.png" alt="enter image description here"></a>
  Is there any way to skip those "$" lines? Sorry for that picture, I have no idea how to attache It better. </p>