title: read in specific values from a file and store them in a list python
body: <p>I have a file in the following format:</p>
  
  <pre><code>-2000 -2000 -2000 # (*THE FRAME, origin point*), 1
  -2000 379 -2000 # 2
   2000 379 -2000 # 3
   2000 -2000 -2000 # 4
  -2000 -2000 -2000 # 1
  j
   2000 379 -1190 # 7
   2000 -2000 -1190 # 8
  -2000 -2000 -1190 # 5
  </code></pre>
  
  <p>I need to read this file in python and store it in a list in the following format:</p>
  
  <pre><code>[[[-2000, -2000, -2000], [-2000 379 -2000], [2000, 379, -2000], [2000, -2000, -2000], [-2000, -2000, -2000]],[[2000, 379, -1190], [2000, -2000, -1190], [-2000, -2000, -1190]]] 
  </code></pre>
  
  <p>so far I have read the file in and stored the values in a list</p>
  
  <pre><code>file = open('filename', 'r')
  vlist = file.readlines()
  file.close
  </code></pre>
  
  <p>then I turn each of the "j" values into [-1,-1,-1] and use that value as a break between lists.</p>
  
  <pre><code>points = []
  points = [list(map(int,elem.split())) if elem.strip().lower() != "j" else [-1, -1, -1]     for elem in vlist]
  </code></pre>
  
  <p>and then using itertools i am able to split this list into groups that are divided everytime [-1,-1,-1] occurs in the list:</p>
  
  <pre><code>pointLists = [list(group) for val, group in groupby(points, lambda x: x == [-1,-1,-1]) if not val]
  </code></pre>
  
  <p>this i believe would give me my desired output however it does not work for the file example I showed up top because it does not remove the #'s and the values that follow it.</p>
  
  <p>i am not sure how to go about removing the #'s and the values that follow from the list so any help would be a great help Thanks.</p>
  
  <pre><code>enter code here
  </code></pre>