title: Parse file text to dictionary in c#
body: <p>I have text file with contains : </p>
  
  <pre>
  0,ke-2,0.0986089045676918
  0,putar,0.141656526869241
  1,film,0.110677581313152
  1,aveng,0.12035192077391
  </pre>
  
  <p>i want to parse the file txt to dictionary with structure like this : </p>
  
  <p><a href="https://i.stack.imgur.com/CswvZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CswvZ.png" alt="structure"></a></p>
  
  <pre><code>    private Dictionary&lt;int, Dictionary&lt;string, double&gt;&gt; openNormalization()
      {
          var temp = new Dictionary&lt;int, Dictionary&lt;string, double&gt;&gt;();
          var file = File.ReadLines("normalization.txt").Cast&lt;string&gt;();
          foreach (string f in file)
          {
              var doc = new Dictionary&lt;string, double&gt;();
              string fwd = "0";
              string[] entry = f.Split(',');
              if (entry[0] == fwd)
              {
                  doc.Add(entry[1], Convert.ToDouble(entry[2]));
                  fwd = entry[0];
              }
              else
              {
                  temp.Add(int.Parse(fwd), doc);
                  doc = new Dictionary&lt;string, double&gt;();
                  doc.Add(entry[1], Convert.ToDouble(entry[2]));
                  fwd = entry[0];
              }
          return temp;
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/2z7cA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2z7cA.png" alt="how ca i fix it?"></a></p>
  
  <p>how can i fix it?</p>