diff --git a/SabreTools.Library/DatFiles/DatFile.cs b/SabreTools.Library/DatFiles/DatFile.cs index fb5207e8..1ad37fba 100644 --- a/SabreTools.Library/DatFiles/DatFile.cs +++ b/SabreTools.Library/DatFiles/DatFile.cs @@ -3056,7 +3056,7 @@ namespace SabreTools.Library.DatFiles // Now parse the correct type of DAT try { - Utilities.GetDatFile(Utilities.GetDatFormat(filename), this)?.ParseFile(filename, sysid, srcid, keep, clean, remUnicode); + Utilities.GetDatFile(filename, this)?.ParseFile(filename, sysid, srcid, keep, clean, remUnicode); } catch (Exception ex) { diff --git a/SabreTools.Library/Tools/Utilities.cs b/SabreTools.Library/Tools/Utilities.cs index 279f925f..dc1de0cd 100644 --- a/SabreTools.Library/Tools/Utilities.cs +++ b/SabreTools.Library/Tools/Utilities.cs @@ -538,7 +538,6 @@ namespace SabreTools.Library.Tools } } - /// /// Create a specific type of BaseReport to be used based on a format and user inputs /// @@ -564,6 +563,18 @@ namespace SabreTools.Library.Tools return null; } + /// + /// Create a specific type of DatFile to be used based on an input file and a base DAT + /// + /// Name of the file to determine the DAT format from + /// DatFile containing the information to use in specific operations + /// DatFile of the specific internal type that corresponds to the inputs + public static DatFile GetDatFile(string input, DatFile baseDat) + { + DatFormat datFormat = GetDatFormat(input); + return GetDatFile(datFormat, baseDat); + } + /// /// Create a specific type of DatFile to be used based on a format and a base DAT ///