Extracting data using fieldnames
<p>I have parsed and extracted lines and field names from a CSV data file using:</p>

<pre><code>reader = csv.DictReader(open('Sourcefile.txt','rt'), delimiter = '\t')
fn = reader.fieldnames
</code></pre>

<p>How do I access the parsed data in any line using the fieldname? For example fieldnames could be <code>AA</code>, <code>BB</code>, <code>CC</code>, <code>DD</code>. How do obtain the value for <code>DD</code> in line 5, or <code>AA</code> in line 3?</p>