Reading in a tab-delimited file as a map instead of a list in Groovy
<p>I want to read in a tab delimited file in Groovy...</p>

<pre><code>inputFile.eachLine { rawLine -&gt;

   def line = rawLine.split('\t')
   def orderId = line[0]
</code></pre>

<p>But instead of having to remember which field is at which column number, I would rather do something like... </p>

<pre><code> def orderId = line['ORDERID']
</code></pre>

<p>Right now if I try this it gives an exception..</p>

<pre><code>groovy.lang.MissingPropertyException: 
Exception evaluating property 'ORDERID' for java.util.Arrays$ArrayList
</code></pre>

<p>I think its because I am reading in each record as a list and not a map. How can I read this same file as a map then?</p>