title: Read 2D array in CSV into a Map c++
body: <p>I am a CPLEX user and I need to convert array data in a CSV file to a C++ 2D Map as input to my optimization problem. The data is present as columns. That is, if we consider 3 rows (AA1, AA2, AA3) and 3 columns (BB1, BB2, BB3) and their respective values, they have the following format in the CSV file:</p>
  
  <p><strong>ROW, COL, VALUE</strong><br>
  AA1, BB1,   0.3<br>
  AA2, BB1,   0.5<br>
  AA1, BB2,   0.6<br>
  AA1, BB3,   0.7<br>
  AA2, BB2,   0.9<br>
  AA3, BB2,   0.5<br>
  AA3, BB1,   0.6<br>
  AA2, BB3,   0.4<br>
  AA3, BB3,   0.6  </p>
  
  <p>As you can see, the data is not sorted either by rows or columns. I hope to read the data into a 2D Map of the format "<strong>map&lt; string, map&lt; string, float >></strong>" such that the resulting map is ordered:</p>
  
  <p><strong>ROW, COL, VALUE</strong><br>
  AA1, BB1,   0.3<br>
  AA1, BB2,   0.6<br>
  AA1, BB3,   0.7<br>
  AA2, BB1,   0.5<br>
  AA2, BB2,   0.9<br>
  AA2, BB3,   0.4<br>
  AA3, BB1,   0.6<br>
  AA3, BB2,   0.5<br>
  AA3, BB3,   0.6  </p>
  
  <p>Any help will be greatly appreciated! Thank you.  </p>
  
  <p><strong>[EDIT]</strong> The number of rows and columns are known in advance - no need to count. I am relatively new to C++ (migrating from the OPL optimization language) and I am not very familiar with file operations. Any sample code will be greatly helpful for me to understand the procedure.</p>