using System.Collections.Generic;
______________________________________________________________________________________________________
DATE: 6/12/2023 12:00:04 AM
SERIES Z POS FOCUS0 FOCUS1 FOCUS2 FOCUS3 FOCUS4
1 10.00525 0.08801 0.07229 0.06474 0.10287 0.11546
1 9.99325 0.09923 0.08002 0.07114 0.11579 0.12486
1 9.98125 0.11740 0.08878 0.07880 0.13022 0.12551
1 9.96925 0.14366 0.09946 0.08740 0.14346 0.11689
1 9.95725 0.17671 0.11388 0.09733 0.14505 0.10312
1 9.94525 0.18247 0.13156 0.10948 0.13173 0.09144
1 9.93325 0.15665 0.15209 0.12640 0.11421 0.08211
1 9.92125 0.13193 0.16052 0.14542 0.09985 0.07498
1 9.90925 0.11292 0.14441 0.15793 0.08842 0.06883
1 9.89725 0.09777 0.12294 0.14723 0.08005 0.06289
1 9.88525 0.08494 0.10384 0.12389 0.07234 0.05801
2 9.91750 0.15404 0.29308 0.33028 0.31821 0.43277
2 9.92550 0.36046 0.44745 0.47603 0.43807 0.52971
2 9.93350 0.55016 0.56322 0.56229 0.52031 0.56136
2 9.94150 0.65980 0.57930 0.59376 0.53092 0.52922
2 9.94950 0.65657 0.48450 0.53619 0.38995 0.39549
2 9.95750 0.55660 0.32726 0.41730 0.21084 0.24739
2 9.96550 0.41468 0.16724 0.26466 0.13177 0.11899
______________________________________________________________________________________________________
DATE: 6/12/2023 12:00:23 AM
SERIES Z POS FOCUS0 FOCUS1 FOCUS2 FOCUS3 FOCUS4
1 10.20063 0.09741 0.08879 0.06386 0.08820 0.11901
1 10.18863 0.11367 0.10012 0.06947 0.09867 0.12474
1 10.17663 0.13742 0.11374 0.07600 0.11149 0.11811
1 10.16463 0.16615 0.13124 0.08345 0.12626 0.10573
1 10.15263 0.17902 0.15007 0.09228 0.14213 0.09284
1 10.14063 0.16302 0.15662 0.10338 0.15402 0.08372
1 10.12863 0.13577 0.14421 0.11795 0.14401 0.07610
1 10.11663 0.11864 0.12340 0.13812 0.12318 0.07038
1 10.10463 0.10213 0.10618 0.15575 0.10577 0.06480
2 10.26062 0.05706 0.05607 0.04630 0.05516 0.08047
2 10.24862 0.06210 0.06060 0.04857 0.05984 0.08668
2 10.23663 0.06823 0.06635 0.05145 0.06528 0.09235
2 10.22463 0.07605 0.07310 0.05476 0.07214 0.10108
2 10.21262 0.08565 0.08050 0.05847 0.07914 0.10986
2 10.20062 0.09828 0.08846 0.06359 0.08876 0.12022
2 10.18863 0.11316 0.09944 0.06934 0.09824 0.12436
2 10.17663 0.13634 0.11400 0.07548 0.11026 0.11848
2 10.16462 0.16477 0.13138 0.08326 0.12540 0.10555
2 10.15262 0.18048 0.14967 0.09214 0.14279 0.09337
2 10.14063 0.16334 0.15569 0.10288 0.15373 0.08413
2 10.12863 0.13666 0.14495 0.11837 0.14473 0.07645
2 10.11662 0.11905 0.12363 0.13783 0.12373 0.07074
2 10.10462 0.10243 0.10643 0.15505 0.10623 0.06520
2 10.09263 0.09048 0.09323 0.15678 0.09319 0.06040
2 10.08063 0.07926 0.08394 0.13654 0.08374 0.05590
3 10.11537 0.24263 0.46639 0.41908 0.52584 0.54745
3 10.12337 0.43610 0.55359 0.51809 0.57243 0.56675
3 10.13137 0.58813 0.52539 0.57941 0.54004 0.46843
3 10.13937 0.64659 0.42439 0.50392 0.40485 0.32114
3 10.14737 0.58643 0.30037 0.38134 0.24828 0.17790
3 10.15537 0.46908 0.18555 0.24859 0.14911 0.11164
4 10.07533 0.00100 0.00100 0.11460 0.06485 0.05216
4 10.08333 0.00100 0.06702 0.13194 0.08097 0.11828
4 10.09133 0.03628 0.11365 0.16202 0.17184 0.22641
4 10.09933 0.16632 0.17358 0.22704 0.30140 0.35232
4 10.10733 0.13130 0.32844 0.33016 0.43749 0.46087
4 10.11533 0.28051 0.48495 0.42963 0.53827 0.55699
4 10.12333 0.45336 0.54168 0.53006 0.56906 0.55310
4 10.13133 0.59028 0.51895 0.57321 0.52561 0.45447
4 10.13933 0.63433 0.40818 0.50346 0.39461 0.31065
4 10.14733 0.57823 0.28429 0.37443 0.24878 0.17688
5 10.09656 0.15875 0.20865 0.31227 0.30260 0.26387
5 10.10456 0.14141 0.34588 0.41908 0.42738 0.38271
5 10.11256 0.28856 0.49461 0.51833 0.53059 0.49212
5 10.12056 0.47197 0.53969 0.57803 0.56609 0.57182
5 10.12856 0.59686 0.50214 0.52577 0.53905 0.51705
5 10.13656 0.64447 0.38819 0.41699 0.41435 0.39881
5 10.14456 0.58610 0.28069 0.29345 0.27295 0.25628
______________________________________________________________________________________________________";
public static void Main()
foreach( var entry in INPUT.Trim().ToWork())
Console.WriteLine(entry.ToString());
foreach( var subentry in entry.Rows )
Console.WriteLine(subentry.ToString());
public static class ParsingExtensions
public static Work[] ToWork(this string input)
var parts = input.Trim().Split('_', StringSplitOptions.RemoveEmptyEntries|StringSplitOptions.TrimEntries);
return parts.Select(x => x.PartToWork()).ToArray();
private static Work PartToWork(this string input)
=> new Work(input.ParseWorkDate(), input.ParseWorkNumber(), input.ParseWorkRows());
private static DateTime ParseWorkDate(this string input)
int dateIndex = input.IndexOf("DATE:") + 5;
int lineEnd = input.IndexOf("\n", dateIndex);
return DateTime.Parse(input[dateIndex..lineEnd].Trim());
private static string ParseWorkNumber(this string input)
int startIndex = input.IndexOf("WORK NUMBER:") + "WORK NUMBER:".Length;
int lineEnd = input.IndexOf("\n", startIndex);
return input[startIndex..lineEnd].Trim();
private static WorkRow[] ParseWorkRows(this string input)
=> input.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries|StringSplitOptions.TrimEntries).Skip(4).Select(l => l.ParseWorkRow()).ToArray();
private static WorkRow ParseWorkRow(this string input)
var line = input.Split(new char[]{' ', '\t'}, StringSplitOptions.RemoveEmptyEntries|StringSplitOptions.TrimEntries);
return new WorkRow(int.Parse(line[0]), Decimal.Parse(line[1]), Decimal.Parse(line[2]), Decimal.Parse(line[3]), Decimal.Parse(line[4]), Decimal.Parse(line[5]), Decimal.Parse(line[6]));
public record Work(DateTime Timestamp, string WorkNumber, ICollection<WorkRow> Rows);
public record WorkRow(int Series, decimal ZPos, decimal Focus0, decimal Focus1, decimal Focus2, decimal Focus3, decimal Focus4);