<div dir="ltr">oops it is reader not Reader (all lower case), so this line : data = csv.Reader(myfile, delimeter = &#39;,&#39;)<br>should be data = csv.reader(myfile, delimeter = &#39;,&#39;)<br><br><br><div class="gmail_quote">
2008/7/31 S Python <span dir="ltr">&lt;<a href="mailto:spython01@gmail.com">spython01@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Everyone,<br>
<br>
Thanks for the variety of responses in such a short amount of time.<br>
This distribution list is incredible.<br>
<br>
Sorry for the delayed reply as I wanted to test what everyone<br>
suggested, so here goes:<br>
<br>
-------------------------------<br>
<br>
@Amin: &nbsp;I tried your suggestion, but perhaps I don&#39;t understand your<br>
syntax. &nbsp;Here is what I tried and the resulting error message:<br>
<br>
&gt;&gt;&gt; f = open(r&#39;C:\test.txt&#39;, &#39;r&#39;)<br>
&gt;&gt;&gt; foo = f.readline.split(&#39;,&#39;)<br>
<br>
Traceback (most recent call last):<br>
 &nbsp;File &quot;&lt;pyshell#16&gt;&quot;, line 1, in &lt;module&gt;<br>
 &nbsp; &nbsp;foo = f.readline.split(&#39;,&#39;)<br>
AttributeError: &#39;builtin_function_or_method&#39; object has no attribute &#39;split&#39;<br>
<br>
Do you know what I did wrong?<br>
<br>
-------------------------------<br>
<br>
@Emad, Brett: &nbsp;Thank you for your solutions. &nbsp;They do exactly what I<br>
was looking for.<br>
<br>
-------------------------------<br>
<br>
@Chad: &nbsp;Thanks for your suggestion. &nbsp;I think I like it best for its simplicity.<br>
<br>
-------------------------------<br>
<br>
@Emile, Monika, kinuthi: &nbsp;The CSV standard library looks interesting<br>
but I am having mixed results in implementing it. &nbsp;For example, it<br>
works when I try this:<br>
<br>
&gt;&gt;&gt; reader = csv.reader(open(r&#39;c:\test.txt&#39;, &#39;rb&#39;))<br>
&gt;&gt;&gt; for row in reader:<br>
 &nbsp; &nbsp; &nbsp; &nbsp;print row<br>
<br>
<br>
[&#39;aaa&#39;, &#39;bbb&#39;, &#39;ccc&#39;]<br>
<br>
but it fails when I try:<br>
<br>
&gt;&gt;&gt; import csv<br>
&gt;&gt;&gt; myfile = open(r&#39;c:\test.txt&#39;, &#39;r&#39;)<br>
<div class="Ih2E3d">&gt;&gt;&gt; data = csv.Reader(myfile, delimeter = &#39;,&#39;)<br>
<br>
</div>Traceback (most recent call last):<br>
 &nbsp;File &quot;&lt;pyshell#26&gt;&quot;, line 1, in &lt;module&gt;<br>
<div class="Ih2E3d"> &nbsp; &nbsp;data = csv.Reader(myfile, delimeter = &#39;,&#39;)<br>
</div>AttributeError: &#39;module&#39; object has no attribute &#39;Reader&#39;<br>
<br>
The error looks similar to what I received when I tried Amin&#39;s<br>
approach. &nbsp;Am I missing something?<br>
<br>
-------------------------------<br>
<br>
It&#39;s interesting to note that for the solutions to work correctly, I<br>
had to remove the quotation marks from the input file.<br>
<br>
Thanks again to EVERYONE who took the time to respond. &nbsp;I appreciate your help.<br>
<br>
Samir<br>
<div><div></div><div class="Wj3C7c">_______________________________________________<br>
Tutor maillist &nbsp;- &nbsp;<a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</div></div></blockquote></div><br></div>