From 7df7d5f4d664c8ff5e5ee842203098b4b77befed Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Thu, 8 May 2025 21:00:30 -0700 Subject: [PATCH] Total User Story Points by Site - Iteration - Assigned To (Initials) --- .../FileHandlers/Markdown/ProcessData.cs | 113 +++++++++++++++++- .../MoveMatchingFiles/FileRead.cs | 64 +++++----- Adaptation/FileHandlers/Priority/FileRead.cs | 2 +- .../FileHandlers/Violation/ProcessData.cs | 98 ++------------- Adaptation/FileHandlers/json/FileRead.cs | 2 +- Adaptation/Shared/FileRead.cs | 18 ++- .../Shared/ProcessDataStandardFormat.cs | 53 +++----- Adaptation/_Tests/Shared/AdaptationTesting.cs | 2 +- 8 files changed, 187 insertions(+), 165 deletions(-) diff --git a/Adaptation/FileHandlers/Markdown/ProcessData.cs b/Adaptation/FileHandlers/Markdown/ProcessData.cs index 0040217..ada4141 100644 --- a/Adaptation/FileHandlers/Markdown/ProcessData.cs +++ b/Adaptation/FileHandlers/Markdown/ProcessData.cs @@ -30,6 +30,9 @@ public class ProcessData : IProcessData Tuple> IProcessData.GetResults(IFileRead fileRead, Logistics logistics, List fileInfoCollection) => new(logistics.Logistics1[0], Array.Empty(), Array.Empty(), fileInfoCollection); + private static string GetClosed(WorkItem workItem) => + workItem.State != "Closed" ? "[ ]" : "[x]"; + public ProcessData(IFileRead fileRead, Logistics logistics, string targetFileLocation, string url, ReadOnlyCollection workItemTypes, List fileInfoCollection) { _Details = new List(); @@ -90,6 +93,7 @@ public class ProcessData : IProcessData ReadOnlyCollection results; ReadOnlyDictionary keyValuePairs = GetWorkItems(workItems, keepRelations); ReadOnlyCollection records = new(keyValuePairs.Values.ToArray()); + ReadOnlyCollection userStoryWorkItemTypes = new(new string[] { "User Story" }); ReadOnlyCollection bugFeatureWorkItemTypes = new(new string[] { "Bug", "Feature" }); ReadOnlyCollection bugUserStoryWorkItemTypes = new(new string[] { "Bug", "User Story" }); messages.AddRange(WriteFile(fileRead, destinationDirectory, fileInfoCollection, records, "records")); @@ -105,6 +109,15 @@ public class ProcessData : IProcessData WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), results, workItemType); _Details.Add(results); } + { + lines.Clear(); + string workItemType = "User Story"; + lines.Add($"# Total User Story Points by Site - Iteration - Assigned To (Initials)"); + lines.Add(string.Empty); + results = UserStoryCheckIterationPath228385(url, lines, userStoryWorkItemTypes, keyValuePairs, workItemType); + WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), results, $"{workItemType} check 228385"); + _Details.Add(results); + } if (messages.Count > 0) throw new Exception($"{messages.Count}{Environment.NewLine}{string.Join(Environment.NewLine, messages)}"); } @@ -283,8 +296,104 @@ public class ProcessData : IProcessData return result; } - private static string GetClosed(WorkItem workItem) => - workItem.State != "Closed" ? "[ ]" : "[x]"; + private static ReadOnlyCollection UserStoryCheckIterationPath228385(string url, List lines, ReadOnlyCollection _, ReadOnlyDictionary keyValuePairs, string workItemType) + { + List results = new(); + long totalStoryPoints; + List collection = new(); + ReadOnlyDictionary> records = GetWorkItemsMatching228385(keyValuePairs, workItemType); + lines.Add(""); + lines.Add($""); + foreach (KeyValuePair> keyValuePair in records) + { + totalStoryPoints = 0; + foreach (Record record in keyValuePair.Value) + { + if (record.WorkItem.StoryPoints is null) + continue; + totalStoryPoints += record.WorkItem.StoryPoints.Value; + } + collection.Add(totalStoryPoints); + } + lines.Add($""); + lines.Add("
{string.Join("", records.Select(l => l.Key))}
{string.Join("", collection)}
"); + lines.Add(string.Empty); + foreach (KeyValuePair> keyValuePair in records) + { + totalStoryPoints = 0; + foreach (Record record in keyValuePair.Value) + { + if (record.WorkItem.StoryPoints is null) + continue; + totalStoryPoints += record.WorkItem.StoryPoints.Value; + } + lines.Add(string.Empty); + lines.Add($"## {keyValuePair.Key} => {totalStoryPoints}"); + lines.Add(string.Empty); + foreach (Record record in keyValuePair.Value) + lines.Add($"- [ ] [{record.WorkItem.Id}]({url}{record.WorkItem.Id}) - {record.WorkItem.Title}"); + } + return new(results); + } + + private static ReadOnlyDictionary> GetWorkItemsMatching228385(ReadOnlyDictionary keyValuePairs, string workItemType) + { + ReadOnlyDictionary> results; + Record record; + List records = new(); + foreach (KeyValuePair keyValuePair in keyValuePairs) + { + record = keyValuePair.Value; + if (record.WorkItem.State is "Removed" or "Closed") + continue; + if (!record.WorkItem.IterationPath.Contains('\\')) + continue; + if (record.WorkItem.StoryPoints is null) + continue; + if (record.WorkItem.WorkItemType != workItemType) + continue; + records.Add(record); + } + Record[] sorted = (from l in records orderby l.WorkItem.AreaPath, l.WorkItem.IterationPath, l.WorkItem.AssignedTo select l).ToArray(); + results = GetWorkItemsMatching228385(new(sorted)); + return results; + } + + private static ReadOnlyDictionary> GetWorkItemsMatching228385(ReadOnlyCollection records) + { + Dictionary> results = new(); + string key; + string[] segments; + List? collection; + foreach (Record record in records) + { + key = $"{record.WorkItem.AreaPath.Split('\\').Last()}-{record.WorkItem.IterationPath.Split('\\').Last().Split(' ').Last()}"; + if (!results.TryGetValue(key, out collection)) + { + results.Add(key, new()); + if (!results.TryGetValue(key, out collection)) + throw new Exception(); + } + collection.Add(record); + } + foreach (Record record in records) + { + if (string.IsNullOrEmpty(record.WorkItem.AssignedTo)) + continue; + segments = record.WorkItem.AssignedTo.Split(' '); + if (segments.Length < 3) + continue; + key = $"{record.WorkItem.IterationPath.Split('\\').Last().Split(' ').Last()}-{segments[0][0]}{segments[1][0]}"; + if (!results.TryGetValue(key, out collection)) + { + results.Add(key, new()); + if (!results.TryGetValue(key, out collection)) + throw new Exception(); + } + collection.Add(record); + } + return new(results); + } internal static List GetDescriptions(JsonElement[] jsonElements) { diff --git a/Adaptation/FileHandlers/MoveMatchingFiles/FileRead.cs b/Adaptation/FileHandlers/MoveMatchingFiles/FileRead.cs index 3379a8c..cf65723 100644 --- a/Adaptation/FileHandlers/MoveMatchingFiles/FileRead.cs +++ b/Adaptation/FileHandlers/MoveMatchingFiles/FileRead.cs @@ -22,17 +22,21 @@ public class FileRead : Shared.FileRead, IFileRead internal class PreWith { - internal string MatchingFile { get; private set; } - internal string CheckFile { get; private set; } internal string ErrFile { get; private set; } + internal string CheckFile { get; private set; } + internal string MatchingFile { get; private set; } internal string CheckDirectory { get; private set; } internal string NoWaitDirectory { get; private set; } - internal PreWith(string matchingFile, string checkFile, string errFile, string checkDirectory, string noWaitDirectory) + internal PreWith(string checkDirectory, + string checkFile, + string errFile, + string matchingFile, + string noWaitDirectory) { - MatchingFile = matchingFile; - CheckFile = checkFile; ErrFile = errFile; + CheckFile = checkFile; + MatchingFile = matchingFile; CheckDirectory = checkDirectory; NoWaitDirectory = noWaitDirectory; } @@ -221,7 +225,11 @@ public class FileRead : Shared.FileRead, IFileRead if (!Directory.Exists(checkDirectory)) _ = Directory.CreateDirectory(checkDirectory); noWaitDirectory = Path.Combine(checkDirectory, "NoWaitDirectory"); - preWith = new(pre.MatchingFile, pre.CheckFile, errFile, checkDirectory, noWaitDirectory); + preWith = new(checkDirectory: checkDirectory, + checkFile: pre.CheckFile, + errFile: errFile, + matchingFile: pre.MatchingFile, + noWaitDirectory: noWaitDirectory); results.Add(preWith); } return results.AsReadOnly(); @@ -260,7 +268,7 @@ public class FileRead : Shared.FileRead, IFileRead } } - private static ReadOnlyCollection
 GetPreCollection(int numberLength, string parentDirectory, ReadOnlyCollection matchingFiles)
+    private static ReadOnlyCollection
 GetPreCollection(int numberLength, string parentDirectory, ReadOnlyCollection matchingFiles, bool _)
     {
         List
 results = new();
         Pre pre;
@@ -275,7 +283,7 @@ public class FileRead : Shared.FileRead, IFileRead
         return results.AsReadOnly();
     }
 
-    private void MoveCollection(DateTime dateTime, ProcessDataStandardFormat? processDataStandardFormat, ReadOnlyCollection preWithCollection)
+    private void MoveCollection(DateTime dateTime, ProcessDataStandardFormat processDataStandardFormat, ReadOnlyCollection preWithCollection)
     {
         ReadOnlyCollection postCollection = GetPostCollection(dateTime, processDataStandardFormat, preWithCollection);
         if (postCollection.Count != 0)
@@ -294,7 +302,7 @@ public class FileRead : Shared.FileRead, IFileRead
         }
     }
 
-    private ReadOnlyCollection GetPostCollection(DateTime dateTime, ProcessDataStandardFormat? processDataStandardFormat, ReadOnlyCollection preWithCollection)
+    private ReadOnlyCollection GetPostCollection(DateTime dateTime, ProcessDataStandardFormat processDataStandardFormat, ReadOnlyCollection preWithCollection)
     {
         List results = new();
         Post post;
@@ -303,15 +311,10 @@ public class FileRead : Shared.FileRead, IFileRead
         {
             if (!_IsEAFHosted)
                 continue;
-            if (processDataStandardFormat is null)
-                File.Move(preWith.MatchingFile, preWith.CheckFile);
-            else
-            {
-                if (!_StaticRuns.TryGetValue(_Logistics.Sequence, out List? wsResults))
-                    wsResults = null;
-                ProcessDataStandardFormat.Write(preWith.CheckFile, processDataStandardFormat, wsResults);
-                File.Delete(preWith.MatchingFile);
-            }
+            if (!_StaticRuns.TryGetValue(_Logistics.Sequence, out List? wsResults))
+                wsResults = null;
+            ProcessDataStandardFormat.Write(preWith.CheckFile, processDataStandardFormat, wsResults);
+            File.Delete(preWith.MatchingFile);
             if (Directory.Exists(preWith.NoWaitDirectory))
             {
                 post = new(preWith.CheckFile, preWith.ErrFile);
@@ -345,16 +348,9 @@ public class FileRead : Shared.FileRead, IFileRead
     private Tuple> GetExtractResult(string reportFullPath, DateTime dateTime)
     {
         Tuple> results = new(string.Empty, Array.Empty(), Array.Empty(), new List());
-        ProcessDataStandardFormat? processDataStandardFormat = ProcessDataStandardFormat.GetProcessDataStandardFormat(reportFullPath, _ProcessDataStandardFormatMapping);
-        if (processDataStandardFormat is not null)
-            _Logistics = new Logistics(reportFullPath, processDataStandardFormat);
-        else
-        {
-            processDataStandardFormat = ProcessDataStandardFormat.GetProcessDataStandardFormat(reportFullPath);
-            _Logistics = new Logistics(reportFullPath, processDataStandardFormat);
-            processDataStandardFormat = null;
-        }
-        if (!_IsEAFHosted && processDataStandardFormat is not null)
+        ProcessDataStandardFormat processDataStandardFormat = ProcessDataStandardFormat.GetProcessDataStandardFormat(reportFullPath, _ProcessDataStandardFormatMapping);
+        _Logistics = new Logistics(reportFullPath, processDataStandardFormat);
+        if (!_IsEAFHosted)
             ProcessDataStandardFormat.Write(".pdsf", processDataStandardFormat, wsResults: null);
         SetFileParameterLotIDToLogisticsMID();
         int numberLength = 2;
@@ -364,10 +360,14 @@ public class FileRead : Shared.FileRead, IFileRead
         ReadOnlyCollection matchingFiles = GetMatchingFiles(ticks, reportFullPath, searchDirectories);
         if (matchingFiles.Count != searchDirectories.Count)
             throw new Exception($"Didn't find all files after {_BreakAfterSeconds} second(s)!");
-        try
-        { CreatePointerFile(numberLength, parentParentDirectory, matchingFiles); }
-        catch (Exception) { }
-        ReadOnlyCollection
 preCollection = GetPreCollection(numberLength, parentParentDirectory, matchingFiles);
+        if (_IsEAFHosted)
+        {
+            try
+            { CreatePointerFile(numberLength, parentParentDirectory, matchingFiles); }
+            catch (Exception) { }
+        }
+        bool mesEntityMatchesProcess = false;
+        ReadOnlyCollection
 preCollection = GetPreCollection(numberLength, parentParentDirectory, matchingFiles, mesEntityMatchesProcess);
         ReadOnlyCollection preWithCollection = GetPreWithCollection(preCollection);
         MoveCollection(dateTime, processDataStandardFormat, preWithCollection);
         return results;
diff --git a/Adaptation/FileHandlers/Priority/FileRead.cs b/Adaptation/FileHandlers/Priority/FileRead.cs
index 6750cc3..b550b53 100644
--- a/Adaptation/FileHandlers/Priority/FileRead.cs
+++ b/Adaptation/FileHandlers/Priority/FileRead.cs
@@ -140,7 +140,7 @@ public class FileRead : Shared.FileRead, IFileRead
         string[] lines = new string[] { string.Empty, "NUM_DATA_ROWS", $"LOGISTICS_1{'\t'}A_JOBID={"BACKLOG"};A_MES_ENTITY={"BACKLOG"};" };
         ProcessDataStandardFormat processDataStandardFormat = ProcessDataStandardFormat.GetProcessDataStandardFormat(reportFullPath, lines);
         _Logistics = new Logistics(reportFullPath, processDataStandardFormat);
-        results = new(_Logistics.Logistics1[0], Array.Empty(), Array.Empty(), new List());
+        results = new(string.Join(Environment.NewLine, _Logistics.Logistics1), Array.Empty(), Array.Empty(), new List());
         return results;
     }
 
diff --git a/Adaptation/FileHandlers/Violation/ProcessData.cs b/Adaptation/FileHandlers/Violation/ProcessData.cs
index d8bbe0a..b065d99 100644
--- a/Adaptation/FileHandlers/Violation/ProcessData.cs
+++ b/Adaptation/FileHandlers/Violation/ProcessData.cs
@@ -30,6 +30,17 @@ public class ProcessData : IProcessData
     Tuple> IProcessData.GetResults(IFileRead fileRead, Logistics logistics, List fileInfoCollection) =>
         new(logistics.Logistics1[0], Array.Empty(), Array.Empty(), fileInfoCollection);
 
+    private static int GetState(WorkItem workItem) =>
+        workItem.State switch
+        {
+            "New" => 1,
+            "Active" => 2,
+            "Resolved" => 3,
+            "Closed" => 4,
+            "Removed" => 5,
+            _ => 8
+        };
+
     public ProcessData(IFileRead fileRead, Logistics logistics, string targetFileLocation, string url, ReadOnlyCollection workItemTypes, List fileInfoCollection)
     {
         if (fileRead.IsEAFHosted)
@@ -66,8 +77,6 @@ public class ProcessData : IProcessData
         ReadOnlyCollection results;
         ReadOnlyDictionary keyValuePairs = GetWorkItems(workItems, keepRelations);
         ReadOnlyCollection records = new(keyValuePairs.Values.ToArray());
-        ReadOnlyCollection userStoryWorkItemTypes = new(new string[] { "User Story" });
-        ReadOnlyCollection bugFeatureWorkItemTypes = new(new string[] { "Bug", "Feature" });
         ReadOnlyCollection bugUserStoryWorkItemTypes = new(new string[] { "Bug", "User Story" });
         ReadOnlyCollection bugUserStoryTaskWorkItemTypes = new(new string[] { "Bug", "User Story", "Task" });
         {
@@ -124,15 +133,6 @@ public class ProcessData : IProcessData
             WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), workItemType, results, "check-122517");
             _Details.Add(results);
         }
-        {
-            lines.Clear();
-            string workItemType = "User Story";
-            lines.Add($"# {nameof(UserStoryCheckIterationPath228385)}");
-            lines.Add(string.Empty);
-            results = UserStoryCheckIterationPath228385(url, lines, userStoryWorkItemTypes, keyValuePairs, workItemType);
-            WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), workItemType, results, "check-228385");
-            _Details.Add(results);
-        }
         if (messages.Count > 0)
             throw new Exception($"{messages.Count}{Environment.NewLine}{string.Join(Environment.NewLine, messages)}");
     }
@@ -475,17 +475,6 @@ public class ProcessData : IProcessData
         return new(results);
     }
 
-    private static int GetState(WorkItem workItem) =>
-        workItem.State switch
-        {
-            "New" => 1,
-            "Active" => 2,
-            "Resolved" => 3,
-            "Closed" => 4,
-            "Removed" => 5,
-            _ => 8
-        };
-
     private static ReadOnlyCollection FeatureCheckState123067(string url, List lines, ReadOnlyCollection workItemTypes, ReadOnlyDictionary keyValuePairs, string workItemType)
     {
         List results = new();
@@ -622,71 +611,6 @@ public class ProcessData : IProcessData
         return new(results);
     }
 
-    private static ReadOnlyCollection UserStoryCheckIterationPath228385(string url, List lines, ReadOnlyCollection _, ReadOnlyDictionary keyValuePairs, string workItemType)
-    {
-        List results = new();
-        long totalStoryPoints;
-        ReadOnlyDictionary> records = GetWorkItemsMatching228385(keyValuePairs, workItemType);
-        foreach (KeyValuePair> keyValuePair in records)
-        {
-            totalStoryPoints = 0;
-            foreach (Record record in keyValuePair.Value)
-            {
-                if (record.WorkItem.StoryPoints is null)
-                    continue;
-                totalStoryPoints += record.WorkItem.StoryPoints.Value;
-            }
-            lines.Add(string.Empty);
-            lines.Add($"## {keyValuePair.Key} => {totalStoryPoints}");
-            lines.Add(string.Empty);
-            foreach (Record record in keyValuePair.Value)
-                lines.Add($"- [ ] [{record.WorkItem.Id}]({url}{record.WorkItem.Id}) - {record.WorkItem.Title}");
-        }
-        return new(results);
-    }
-
-    private static ReadOnlyDictionary> GetWorkItemsMatching228385(ReadOnlyDictionary keyValuePairs, string workItemType)
-    {
-        ReadOnlyDictionary> results;
-        Record record;
-        List records = new();
-        foreach (KeyValuePair keyValuePair in keyValuePairs)
-        {
-            record = keyValuePair.Value;
-            if (record.WorkItem.State is "Removed" or "Closed")
-                continue;
-            if (!record.WorkItem.IterationPath.Contains('\\'))
-                continue;
-            if (record.WorkItem.StoryPoints is null)
-                continue;
-            if (record.WorkItem.WorkItemType != workItemType)
-                continue;
-            records.Add(record);
-        }
-        Record[] sorted = records.OrderByDescending(l => l.WorkItem.IterationPath).ToArray();
-        results = GetWorkItemsMatching228385(new(sorted));
-        return results;
-    }
-
-    private static ReadOnlyDictionary> GetWorkItemsMatching228385(ReadOnlyCollection records)
-    {
-        Dictionary> results = new();
-        string key;
-        List? collection;
-        foreach (Record record in records)
-        {
-            key = $"{record.WorkItem.IterationPath}-{record.WorkItem.AssignedTo}";
-            if (!results.TryGetValue(key, out collection))
-            {
-                results.Add(key, new());
-                if (!results.TryGetValue(key, out collection))
-                    throw new Exception();
-            }
-            collection.Add(record);
-        }
-        return new(results);
-    }
-
     internal static List GetDescriptions(JsonElement[] jsonElements)
     {
         List results = new();
diff --git a/Adaptation/FileHandlers/json/FileRead.cs b/Adaptation/FileHandlers/json/FileRead.cs
index 48a49f0..dd893b0 100644
--- a/Adaptation/FileHandlers/json/FileRead.cs
+++ b/Adaptation/FileHandlers/json/FileRead.cs
@@ -363,7 +363,7 @@ public class FileRead : Shared.FileRead, IFileRead
         _Logistics = new Logistics(reportFullPath, processDataStandardFormat);
         if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
             MoveJson(reportFullPath, dateTime);
-        results = new(_Logistics.Logistics1[0], Array.Empty(), Array.Empty(), new List());
+        results = new(string.Join(Environment.NewLine, _Logistics.Logistics1), Array.Empty(), Array.Empty(), new List());
         return results;
     }
 
diff --git a/Adaptation/Shared/FileRead.cs b/Adaptation/Shared/FileRead.cs
index 8693acb..49a4526 100644
--- a/Adaptation/Shared/FileRead.cs
+++ b/Adaptation/Shared/FileRead.cs
@@ -377,17 +377,25 @@ public class FileRead : Properties.IFileRead
 
     internal string[] GetInProcessDirectory(string jobIdDirectory)
     {
-        string[] results;
+        List results = new();
         if (!_IsEAFHosted)
-            results = new string[] { jobIdDirectory };
+            results = new string[] { jobIdDirectory }.ToList();
         else
         {
+            string[] files;
             string logisticsSequence = _Logistics.Sequence.ToString();
-            results = Directory.GetDirectories(jobIdDirectory, $"*{logisticsSequence}*", SearchOption.TopDirectoryOnly);
+            string[] directories = Directory.GetDirectories(jobIdDirectory, $"*{logisticsSequence}*", SearchOption.TopDirectoryOnly);
+            foreach (string directory in directories)
+            {
+                files = Directory.GetFiles(directory, "*", SearchOption.TopDirectoryOnly);
+                if (files.Length == 0)
+                    continue;
+                results.Add(directory);
+            }
         }
-        if ((results is null) || results.Length != 1)
+        if ((results is null) || results.Count != 1)
             throw new Exception("Didn't find directory by logistics sequence");
-        return results;
+        return results.ToArray();
     }
 
     protected static string[] GetMatches(FileConnectorConfiguration fileConnectorConfiguration)
diff --git a/Adaptation/Shared/ProcessDataStandardFormat.cs b/Adaptation/Shared/ProcessDataStandardFormat.cs
index 62fb6a3..e39d4e8 100644
--- a/Adaptation/Shared/ProcessDataStandardFormat.cs
+++ b/Adaptation/Shared/ProcessDataStandardFormat.cs
@@ -61,8 +61,8 @@ internal class ProcessDataStandardFormat
     internal static string Archive(bool addSpaces = true, char separator = ' ') =>
         GetString(SearchFor.Archive, addSpaces, separator);
 
-    internal static ProcessDataStandardFormat GetEmpty() =>
-        new(new(Array.Empty()), new(Array.Empty()), new(Array.Empty()), new(Array.Empty()), null, new(Array.Empty()), null);
+    internal static ProcessDataStandardFormat GetEmpty(Logistics logistics) =>
+        new(new(Array.Empty()), new(Array.Empty()), new(Array.Empty()), new(Array.Empty()), null, new(logistics.Logistics1), null);
 
     internal static List PDSFToFixedWidth(string reportFullPath)
     {
@@ -214,25 +214,26 @@ internal class ProcessDataStandardFormat
         return results.AsReadOnly();
     }
 
-    internal static ProcessDataStandardFormat? GetProcessDataStandardFormat(string reportFullPath, ProcessDataStandardFormatMapping pdsfMapping)
+    internal static ProcessDataStandardFormat GetProcessDataStandardFormat(string reportFullPath, ProcessDataStandardFormatMapping pdsfMapping)
     {
-        ProcessDataStandardFormat? result;
+        ProcessDataStandardFormat result;
         const int columnsLine = 6;
         FileInfo fileInfo = new(reportFullPath);
-        ProcessDataStandardFormat processDataStandardFormat = GetProcessDataStandardFormat(fileInfo.LastWriteTime, pdsfMapping.NewColumnNames.Count, columnsLine, fileInfo.FullName, lines: null);
-        JsonElement[]? jsonElements = GetArray(pdsfMapping.NewColumnNames.Count, processDataStandardFormat, lookForNumbers: false);
-        if (jsonElements is null || jsonElements.Length == 0 || pdsfMapping.OldColumnNames.Count != pdsfMapping.ColumnIndices.Count)
-            result = null;
+        ProcessDataStandardFormat processDataStandardFormat = GetProcessDataStandardFormat(fileInfo.LastWriteTime, columnsLine, fileInfo.FullName, lines: null);
+        JsonElement[]? jsonElements = pdsfMapping.OldColumnNames.Count != pdsfMapping.ColumnIndices.Count ? null : GetFullArray(processDataStandardFormat);
+        JsonProperty[]? jsonProperties = jsonElements is null || jsonElements.Length == 0 ? null : jsonElements[0].EnumerateObject().ToArray();
+        if (jsonElements is null || jsonProperties is null || jsonProperties.Length != pdsfMapping.NewColumnNames.Count)
+            result = processDataStandardFormat;
         else
         {
             result = GetProcessDataStandardFormat(pdsfMapping, jsonElements, processDataStandardFormat);
             if (result.Sequence is null || result.Columns.Count == 0 || result.Body.Count == 0 || result.Logistics.Count == 0)
-                result = null;
+                result = processDataStandardFormat;
         }
         return result;
     }
 
-    private static ProcessDataStandardFormat GetProcessDataStandardFormat(DateTime lastWriteTime, int expectedColumns, int columnsLine, string path, string[]? lines)
+    private static ProcessDataStandardFormat GetProcessDataStandardFormat(DateTime lastWriteTime, int columnsLine, string path, string[]? lines)
     {
         ProcessDataStandardFormat result;
         long sequence;
@@ -248,8 +249,6 @@ internal class ProcessDataStandardFormat
         else
         {
             segments = lines[columnsLine].Split('\t');
-            if (segments.Length != expectedColumns)
-                segments = Array.Empty();
             for (int i = 0; i < columnsLine; i++)
                 header.Add(lines[i]);
         }
@@ -285,7 +284,7 @@ internal class ProcessDataStandardFormat
         return result;
     }
 
-    private static JsonElement[]? GetArray(int expectedColumns, ProcessDataStandardFormat processDataStandardFormat, bool lookForNumbers)
+    private static JsonElement[]? GetFullArray(ProcessDataStandardFormat processDataStandardFormat)
     {
         JsonElement[]? results;
         if (processDataStandardFormat.Body.Count == 0 || !processDataStandardFormat.Body[0].Contains('\t'))
@@ -293,36 +292,18 @@ internal class ProcessDataStandardFormat
         else
         {
             string value;
-            string[] segments;
+            List segments;
             List lines = new();
             StringBuilder stringBuilder = new();
             foreach (string bodyLine in processDataStandardFormat.Body)
             {
                 _ = stringBuilder.Clear();
                 _ = stringBuilder.Append('{');
-                segments = bodyLine.Split('\t');
-                if (segments.Length != expectedColumns)
-                    continue;
-                if (!lookForNumbers)
+                segments = bodyLine.Split('\t').ToList();
+                for (int c = 0; c < segments.Count; c++)
                 {
-                    for (int c = 0; c < segments.Length; c++)
-                    {
-                        value = segments[c].Replace("\"", "\\\"").Replace("\\", "\\\\");
-                        _ = stringBuilder.Append('"').Append(processDataStandardFormat.Columns[c]).Append("\":\"").Append(value).Append("\",");
-                    }
-                }
-                else
-                {
-                    for (int c = 0; c < segments.Length; c++)
-                    {
-                        value = segments[c].Replace("\"", "\\\"").Replace("\\", "\\\\");
-                        if (string.IsNullOrEmpty(value))
-                            _ = stringBuilder.Append('"').Append(processDataStandardFormat.Columns[c]).Append("\":").Append(value).Append("null,");
-                        else if (value.All(char.IsDigit))
-                            _ = stringBuilder.Append('"').Append(processDataStandardFormat.Columns[c]).Append("\":").Append(value).Append(',');
-                        else
-                            _ = stringBuilder.Append('"').Append(processDataStandardFormat.Columns[c]).Append("\":\"").Append(value).Append("\",");
-                    }
+                    value = segments[c].Replace("\"", "\\\"").Replace("\\", "\\\\");
+                    _ = stringBuilder.Append('"').Append(processDataStandardFormat.Columns[c]).Append("\":\"").Append(value).Append("\",");
                 }
                 _ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
                 _ = stringBuilder.AppendLine("}");
diff --git a/Adaptation/_Tests/Shared/AdaptationTesting.cs b/Adaptation/_Tests/Shared/AdaptationTesting.cs
index e461be5..8c0bc93 100644
--- a/Adaptation/_Tests/Shared/AdaptationTesting.cs
+++ b/Adaptation/_Tests/Shared/AdaptationTesting.cs
@@ -1182,7 +1182,7 @@ public class AdaptationTesting : ISMTP
             Assert.IsNotNull(extractResult.Item3);
             Assert.IsNotNull(extractResult.Item4);
             if (!validatePDSF)
-                _ = GetProcessDataStandardFormat(fileRead, logistics, extractResult, ProcessDataStandardFormat.GetEmpty());
+                _ = GetProcessDataStandardFormat(fileRead, logistics, extractResult, ProcessDataStandardFormat.GetEmpty(logistics));
             else
             {
                 Assert.IsTrue(extractResult.Item3.Length > 0, "extractResult Array Length check!");