title: EPPlus Reading Column Headers
body: <p>Is there an easy way to tell EPPlus that a row is a header? Or should I create the headers by specifying a range using SelectedRange, remove it from the sheet and iterate the cells that remain?</p>
  
  <p>I ended up doing this:</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          DirectoryInfo outputDir = new DirectoryInfo(@"C:\testdump\excelimports");
          FileInfo existingFile = new FileInfo(outputDir.FullName + @"\Stormers.xlsx");
          Dictionary&lt;string, string&gt; arrColumnNames = new Dictionary&lt;string,string&gt;() { { "First Name", "" }, { "Last Name", "" }, { "Email Address", "" } };
          using (ExcelPackage package = new ExcelPackage(existingFile))
          {
              ExcelWorksheet sheet = package.Workbook.Worksheets[1];
              var q = from cell in sheet.Cells
                      where arrColumnNames.ContainsKey(cell.Value.ToString())
                      select cell;
  
              foreach (var c in q)
              {
                  arrColumnNames[c.Value.ToString()] = c.Address;
              }
              foreach (var ck in arrColumnNames)
              {
                  Console.WriteLine("{0} - {1}", ck.Key, ck.Value);
              }
  
              var qValues = from r in sheet.Cells
                            where !arrColumnNames.ContainsValue(r.Address.ToString())
                            select r;
  
              foreach (var r in qValues)
              {
                  Console.WriteLine("{0} - {1}", r.Address, r.Value);
              }
          }
      }
  }
  </code></pre>