UniqueId replacement for attachments
Write input PDSF in output after EOF MoveMatchingFile GetPropertyValue for MoveMatchingFiles ProcessDataStandardFormat over Tuple MoveMatchingFiles to use ProcessDataStandardFormatMapping
This commit is contained in:
@ -28,14 +28,17 @@ internal class ProcessDataStandardFormat
|
||||
internal ReadOnlyCollection<string> Body { get; private set; }
|
||||
internal ReadOnlyCollection<string> Columns { get; private set; }
|
||||
internal ReadOnlyCollection<string> Logistics { get; private set; }
|
||||
internal ReadOnlyCollection<string> InputLines { get; private set; }
|
||||
|
||||
internal ProcessDataStandardFormat(ReadOnlyCollection<string> body,
|
||||
ReadOnlyCollection<string> columns,
|
||||
ReadOnlyCollection<string> inputLines,
|
||||
ReadOnlyCollection<string> logistics,
|
||||
long? sequence)
|
||||
{
|
||||
Body = body;
|
||||
Columns = columns;
|
||||
InputLines = inputLines;
|
||||
Logistics = logistics;
|
||||
Sequence = sequence;
|
||||
}
|
||||
@ -53,7 +56,7 @@ internal class ProcessDataStandardFormat
|
||||
GetString(SearchFor.Archive, addSpaces, separator);
|
||||
|
||||
internal static ProcessDataStandardFormat GetEmpty() =>
|
||||
new(new(Array.Empty<string>()), new(Array.Empty<string>()), new(Array.Empty<string>()), null);
|
||||
new(new(Array.Empty<string>()), new(Array.Empty<string>()), new(Array.Empty<string>()), new(Array.Empty<string>()), null);
|
||||
|
||||
internal static List<string> PDSFToFixedWidth(string reportFullPath)
|
||||
{
|
||||
@ -169,7 +172,7 @@ internal class ProcessDataStandardFormat
|
||||
{
|
||||
for (int i = r; i < lines.Length; i++)
|
||||
{
|
||||
if (lines[i].StartsWith("END_HEADER"))
|
||||
if (!lines[i].StartsWith("LOGISTICS_") || lines[i].StartsWith("END_HEADER"))
|
||||
break;
|
||||
logistics.Add(lines[i]);
|
||||
}
|
||||
@ -180,6 +183,7 @@ internal class ProcessDataStandardFormat
|
||||
logistics.Add(lines[1]);
|
||||
result = new(body: body.AsReadOnly(),
|
||||
columns: columns.AsReadOnly(),
|
||||
inputLines: lines.ToList().AsReadOnly(),
|
||||
logistics: logistics.AsReadOnly(),
|
||||
sequence: null);
|
||||
return result;
|
||||
@ -234,7 +238,7 @@ internal class ProcessDataStandardFormat
|
||||
{
|
||||
for (int i = r; i < lines.Length; i++)
|
||||
{
|
||||
if (lines[i].StartsWith("END_HEADER"))
|
||||
if (!lines[i].StartsWith("LOGISTICS_") || lines[i].StartsWith("END_HEADER"))
|
||||
break;
|
||||
logistics.Add(lines[i]);
|
||||
}
|
||||
@ -250,6 +254,7 @@ internal class ProcessDataStandardFormat
|
||||
}
|
||||
result = new(body: body.AsReadOnly(),
|
||||
columns: new(columns),
|
||||
inputLines: lines.ToList().AsReadOnly(),
|
||||
logistics: logistics.AsReadOnly(),
|
||||
sequence: sequence);
|
||||
return result;
|
||||
@ -341,6 +346,7 @@ internal class ProcessDataStandardFormat
|
||||
}
|
||||
result = new(body: new(results),
|
||||
columns: processDataStandardFormatMapping.OldColumnNames,
|
||||
inputLines: processDataStandardFormat.InputLines,
|
||||
logistics: processDataStandardFormat.Logistics,
|
||||
sequence: processDataStandardFormat.Sequence);
|
||||
return result;
|
||||
@ -372,6 +378,8 @@ internal class ProcessDataStandardFormat
|
||||
results.Add("LOGISTICS_COLUMN\tA_LOGISTICS");
|
||||
results.Add("LOGISTICS_COLUMN\tB_LOGISTICS");
|
||||
results.AddRange(processDataStandardFormat.Logistics);
|
||||
results.Add("EOF");
|
||||
results.AddRange(processDataStandardFormat.InputLines.Select(l => l.Replace('\t', '|')));
|
||||
File.WriteAllText(path, string.Join(Environment.NewLine, results));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user