private static (IList <DelimitedFileRow>, IDictionary <String, int>) CreateDelimitedRowObjects(IList <String> lines, IDictionary <String, int> columnNameIndexes, Char delimiter, String keyName)
        {
            IDictionary <String, int> KeyNameToRowIndex = new Dictionary <String, int>();
            IList <DelimitedFileRow>  rows = new List <DelimitedFileRow>();

            bool isKeyNameSpecified = !String.IsNullOrEmpty(keyName);

            foreach (String currentLine in lines)
            {
                #region Locate columns and add to list
                DelimitedFileRow delimitedFileRow = new DelimitedFileRow();

                PopulateRow(delimiter, columnNameIndexes, currentLine, delimitedFileRow, keyName);

                #endregion

                rows.Add(delimitedFileRow);

                if (isKeyNameSpecified)
                {
                    String keyNameValue = DelimitedFile.GetKey(delimitedFileRow[keyName].Value.ToString());
                    if (!KeyNameToRowIndex.ContainsKey(keyNameValue))
                    {
                        KeyNameToRowIndex.Add(keyNameValue, rows.Count - 1);
                    }
                }
            }
            return(rows, KeyNameToRowIndex);
        }
        public static IList <DelimitedFileRow> Compare(DelimitedFile oldFile, DelimitedFile newFile)
        {
            IList <DelimitedFileRow> unmatchedValues = new List <DelimitedFileRow>();

            foreach (DelimitedFileRow oldRow in oldFile.Rows)
            {
                var match = newFile.Rows.FirstOrDefault(newRow => newRow == oldRow);
                if (match is null)
                {
                    unmatchedValues.Add(oldRow);
                }
            }
            return(unmatchedValues);
        }