public string this[string headingName] { get { if (!HasHeadings) { throw new Exception("CSV file has no headings."); } else if (!Headings.Contains(headingName)) { throw new Exception(String.Format("CSV file doesn't have a heading named '{0}'.", headingName)); } else { return(this[Headings.IndexOf(headingName)]); } } }