title: Split up a text file based on its contents
body: <p>I have a text file that looks like this:</p>
  
  <pre><code>SYSTEM
  
  DOF=UY,UZ,RX  LENGTH=FT  FORCE=Kip
  
  JOINT
    1  X=0  Y=-132.644  Z=0
    2  X=0  Y=-80  Z=0
    3  X=0  Y=-40  Z=0
    4  X=0  Y=0  Z=0
    5  X=0  Y=40  Z=0
    6  X=0  Y=80  Z=0
    7  X=0  Y=132.644  Z=0
  </code></pre>
  
  <p>etc. for 10,000 joints.</p>
  
  <p>I would like to write a script that reads this text file and outputs 4 text files that are 1 column each containing the joint number, x coordinate, y coordinate, and z coordinate. </p>
  
  <p>Is this possible? I am new to python and tried something like this but Python doesn't know what to do with System in the text file and I'm sure my method isn't correct: </p>
  
  <pre><code>os.chdir('/Users/DevEnv/')
  
  with open('RawDataFile_445.txt') as a:
      for line in a.readlines():
          j=[]
          data=line.strip()
          data1=data.split(" ")
          for i in range(0,len(data1)):
              j.append(eval(data1[i]))
          joint=j
  </code></pre>