/// <summary> /// Get values by header name. Use Headers component to get all the names. /// </summary> /// <param name="header">Name of the header.</param> /// <returns></returns> public List <object> ValuesByHeaderName(string header) { var output = new List <object>(); var headerIndex = InternalCsv.GetFieldIndex(header); for (var i = 0; i < RowCount; i++) { output.Add(Data[new Tuple <int, int>(i, headerIndex)]); } return(output); }
/// <summary> /// Get row number based on column and matching string. /// </summary> /// <param name="searchFor">Search string.</param> /// <param name="header">Header name.</param> /// <returns></returns> public List <int> RowNumberByHeaderAndString(string searchFor, string header) { var output = new List <int>(); var headerIndex = InternalCsv.GetFieldIndex(header); for (var i = 0; i < RowCount; i++) { if (Data[new Tuple <int, int>(i, headerIndex)].ToString().Contains(searchFor)) { output.Add(i); } } return(output); }