diff --git a/ENI2/Excel/ExcelUtil.cs b/ENI2/Excel/ExcelUtil.cs index d1d3fbf4..62d4d3dd 100644 --- a/ENI2/Excel/ExcelUtil.cs +++ b/ENI2/Excel/ExcelUtil.cs @@ -980,7 +980,15 @@ namespace ENI2.Excel stat.PortOfRegistry = reader.ReadLoCode("STAT.PortOfRegistry", false); if (stat.PortOfRegistry.Length == 5) + { stat.Flag = stat.PortOfRegistry.Substring(0, 2); + } + else + { + string statFlagString = reader.ReadText("STAT.PortOfRegistry")?.ToUpper(); + if (statFlagString.Length >= 2) + stat.Flag = statFlagString.Substring(0, 2); + } stat.MMSINumber = reader.ReadTextNoWhitespace("STAT.MMSINumber"); stat.CallSign = reader.ReadTextNoWhitespace("STAT.CallSign"); stat.ISMCompanyId = reader.ReadTextNoWhitespace("STAT.ISMCompanyId");