diff --git a/Repopulator/CsvToDicomTagMapping.cs b/Repopulator/CsvToDicomTagMapping.cs index b6b6a19..1006292 100644 --- a/Repopulator/CsvToDicomTagMapping.cs +++ b/Repopulator/CsvToDicomTagMapping.cs @@ -73,10 +73,11 @@ public bool BuildMap(DicomRepopulatorOptions options, out string log) CsvFile = options.CsvFileInfo; - using (var reader = new CsvReader(CsvFile.OpenText(), new(System.Globalization.CultureInfo.CurrentCulture) + var conf = new CsvConfiguration(System.Globalization.CultureInfo.CurrentCulture) { - TrimOptions = TrimOptions.Trim - })) + TrimOptions=TrimOptions.Trim + }; + using (var reader = new CsvReader(CsvFile.OpenText(), conf)) { reader.Read(); var couldReadHeader = reader.ReadHeader(); diff --git a/Repopulator/Matchers/TagMatcher.cs b/Repopulator/Matchers/TagMatcher.cs index bcdc2ab..dbde1ec 100644 --- a/Repopulator/Matchers/TagMatcher.cs +++ b/Repopulator/Matchers/TagMatcher.cs @@ -33,10 +33,11 @@ public TagMatcher(CsvToDicomTagMapping map, DicomRepopulatorOptions options):bas if(_indexer == null) throw new ArgumentException("No valid indexer could be found, there must be a column in the map for either SOP, Series or Study instance UIDs"); - using var reader = new CsvReader(map.CsvFile.OpenText(), new(System.Globalization.CultureInfo.CurrentCulture) + var conf = new CsvConfiguration(System.Globalization.CultureInfo.CurrentCulture) { - TrimOptions = TrimOptions.Trim - }); + TrimOptions=TrimOptions.Trim; + }; + using var reader = new CsvReader(map.CsvFile.OpenText(), conf); while (reader.Read()) { string key = reader[_indexer.Index];