LinqToCsv LINQtoCSV Newtonsoft.Json void Main() { var thefile = @"D:\Users\tlamb\Downloads\DimCaseType QA Master.csv"; var csvdata = File.ReadAllLines(thefile); //csvdata.Dump(); var inputFileDescription = new CsvFileDescription { SeparatorChar = ',', FirstLineHasColumnNames = false, EnforceCsvColumnAttribute = true, IgnoreUnknownColumns = true, UseFieldIndexForReadingData = true }; var cc = new CsvContext(); var data = cc.Read(thefile, inputFileDescription).ToList(); //data.Dump(); string.Join("\r\n", data.ConvertAll(d => $"UPDATE dss.DimCaseType SET CaseTypeConfigJSON = '{d.CaseTypeConfigJSON}' WHERE Name = '{d.Name}' and CaseTypeID = {d.CaseTypeID};")).Dump(); } // Define other methods and classes here public class DimCaseType { [CsvColumn(FieldIndex = 1)] public int CaseTypeID { get; set; } [CsvColumn(FieldIndex = 2)] public string Name { get; set; } [CsvColumn(FieldIndex = 3)] public string CaseTypeConfigJSON { get; set; } //public MSDRGCaseTypeConfiguration CaseTypeConfig => JsonConvert.DeserializeObject(CaseTypeConfigJSON); } public class CaseTypeConfiguration { public int PhysicianMinVolume { get; set; } = 0; } public class DRGCaseTypeConfiguration : CaseTypeConfiguration { public List AgeCohortIDInclusions { get; set; } = new List(); public List PhysicianIDExclusions { get; set; } = new List(); public StandardDeviationExclusions StandardDeviationExcludedTypeEnum { get; set; } = StandardDeviationExclusions.None; public int LengthOfStayThreshold { get; set; } = 0; public HashSet CPTCodes { get; set; } = new HashSet(); public List PatientTypeRollupIDInclusions { get; set; } = new List(); } public class MSDRGCaseTypeConfiguration : DRGCaseTypeConfiguration #pragma warning restore S101 // Types should be named in PascalCase { public HashSet CCMCCCategories { get; set; } = new HashSet(); } public enum CCMCCCategoryTypes #pragma warning restore S2342 // Enumeration types should comply with a naming convention { None, CC, MCC, WO, NA, CCMCC } public enum StandardDeviationExclusions { None = 0, TwoStdDev = 1, ThreeStdDev = 2, CustomLOSOutlier = 3 } public enum PhysicianGroupingTypes { Physician = 0, Specialty = 1, GroupAffiliation = 2 } public enum CaseTypeCategories { MSDRG = 0, APRDRG = 1, PatientPopulation = 2 }