Esempio n. 1
0
        public static void SerialNumberComparison(String missingFileName, String outputFileName)
        {
            ExtendedCSV extended = new ExtendedCSV(
                new FileStream(missingFileName, FileMode.Open), new List <string>()
            {
                "Serial No"
            });

            ExtendedCSV other = new ExtendedCSV(
                new FileStream("/Users/jcox/Documents/employee_laptop_serials.csv", FileMode.Open), new List <string>()
            {
                "Serial No"
            })
            {
                ConflictRule = new PickTheFirstConflictRule()
            };

            other.NormalizeColumns(new SerialNumberNormalizationRule()
            {
                Capitalize = true
            }, new List <String>()
            {
                "Serial No"
            });

            other = new ExtendedCSV(other.FlattenRows(), new List <string>()
            {
                "Serial No"
            });
            other.Save("/Users/jcox/Documents/employee_laptop_serials.csv");
            ExtendedCSV output = new ExtendedCSV(extended.PullRowsMatchingPrimaryKeysWith(other), new List <String>()
            {
                "Serial No"
            });

            output.GetDataColumnsFrom(other, new List <String>()
            {
                "First", "Last"
            });
            output.Save(outputFileName);
        }
Esempio n. 2
0
        public static void ConsolidateData(String handsOnFileName, String exportedFileName, String mergedFileName)
        {
            ExtendedCSV extended = new ExtendedCSV(
                new FileStream(handsOnFileName, FileMode.Open), new List <string>()
            {
                "WASP"
            }
                );

            ExtendedCSV other = new ExtendedCSV(
                new FileStream(exportedFileName, FileMode.Open), new List <string>()
            {
                "WASP"
            }
                );

            extended.GetDataColumnsFrom(other, new List <string>()
            {
                "Serial No", "Model"
            });

            extended.Save(mergedFileName);
        }