title: How do I find and list duplicate rows based on columns in a CSV file using C#. Matching/Grouping Rows.
body: <p>I converted an excel file into a CSV file. The file contains over 100k records. I'm wanting to search and return duplicate rows by searching the full name column. If the full name's match up I want the program to return the entire rows of the duplicates. I started with a code that returns a list of full names but that's about it. </p>
  
  <p>I've listed the code that I have now below:</p>
  
  <pre><code>public static void readCells()
      {
          var dictionary = new Dictionary&lt;string, int&gt;();
  
          Console.WriteLine("started");
          var counter = 1;
          var readText = File.ReadAllLines(path);
          var duplicatedValues = dictionary.GroupBy(fullName =&gt; fullName.Value).Where(fullName =&gt; fullName.Count() &gt; 1);
  
          foreach (var s in readText)
          {
              var values = s.Split(new Char[] { ',' });
              var fullName = values[3];
              if (!dictionary.ContainsKey(fullName))
              {
                  dictionary.Add(fullName, 1);
              }
              else
              {
                  dictionary[fullName] += 1;
  
              }
              Console.WriteLine("Full Name Is: " + values[3]);
  
              counter++;
          }
  
      }
  }
  </code></pre>