<div class="gmail_quote">On Mon, Mar 14, 2011 at 12:08 PM, paige crawford <span dir="ltr">&lt;<a href="mailto:plcrawford@crimson.ua.edu">plcrawford@crimson.ua.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hey,
<div><br></div><div><br></div><div>How do I read in a data file that has comments then remove the comments to get to the numbers? The numbers in the data file needs to be read into a list. There are also comments next to the numbers. The file looks something like this</div>

<div><br></div><div># DO NOT MODIFY</div><div>#</div><div># This file is for the eyebrows<br>#</div><div>#  Read in these numbers<br>#<br>#<br>#</div><div><br></div><div>3 # This is the amount of items in each list, m</div>

<div><br></div><div>30        #  number 1</div><div>10        # number 3</div><div>-110     # number 9</div><div><br></div><div>39 40 30 </div><div><br></div><div>48 390  # extra data</div>
<br></blockquote><div><br>Those lines with multiple numbers (e.g. &quot;39 40 30&quot;) - do you want to add 39, 40, and 30 to the list, or &quot;39 40 30&quot;?  <br><br>If you want to add the whole line as a unit, then just read each line, split() at the #, strip() the first part, and add it to the list.<br>
<br>If you want them to be separate numbers, then read each line, split() at the #, split() the first part by spaces, and add each item to the list.<br><br></div></div>