title: Parse CSV in bash and assign variables
body: <p>I have a csv of the format (Working on Bash on linux) </p>
  
  <pre><code>DN , MAC , Partition ,  
  
  123 , abc , xyz  
  321 , asd , asd 
  </code></pre>
  
  <p>I am able to parse it using awk by using </p>
  
  <pre><code>eval MAC=($(awk -F "," '{print $1}' random.csv))
  </code></pre>
  
  <p>This is done for each column in the CSV and therefore I can call <code>DN[2]</code>, <code>MAC[2]</code> etc individually which is manual and parses them individually.</p>
  
  <p>But how can I parse the csv by row?
  For example : If I call for <code>DN</code> is <code>123</code>, the corresponding <code>MAC</code> and <code>Partition</code> should also be returned.</p>