这是来自串行工具运行 6 次以上的数据。我必须能够一致地解析每一行数据。
有没有人对我如何修复这些数据有建议,以便我可以确保它的完整性?
\r\n
第一行的末尾确实有一个。有时它会破坏排队,有时它会在随机位置破坏它。我什至不能确定它不会侵蚀数据包编号后面的十六进制的重要数据。如果我能确保数据是健全的,我就可以做类似的事情value.Split(':')[1].Split(' ')[1]
并完成它。我只是想不出任何方法将它拼接在一起。此外,需要明确的是,整个数据集都在一个字符串中,因为它必须从工具中读取。所以,我只是在做string[] values = message.Split('\n');
然后用foreach
循环迭代。
Packe
t 0: 1A064140084243440842555803EE (overlay)
Packet 1: 1A06414258404643440842585503EE
Packet 2: 1D0608054203EE
Packet 3: 1D0608427273747571505703EE
...
Packet 0: 1A064140084243440842555803EE (overlay)
Packet 1: 1A06414258404643440842585503EE
Packet 2: 1D0608054203EE
Packet 3: 1D0608427273747571505703EE
...
P
acket 0: 1A064140084243440842555803EE (overlay)
Packet 1: 1A06414258404643
Packet 2: 1D0608054203EE
Packet 3: 1D0608427273747571505703EE
...
Packet 0
: 1A064140084243440842555803EE (overlay)
Packet 1: 1A06414258404643440842585503EE
Packet 2: 1D0608054203EE
Packet 3: 1D0608427273747571505703EE
...
Pack
et 0: 1A064140084243440842555803EE (overlay)
Packet 1: 1A06414258404643440842585503EE
Packet 2: 1D0608054203EE
Packet 3: 1D0608427273747571505703EE
...
Packet 0: 1A064140084243440842555803EE (overlay)
Packet 1: 1A06414258404643440842585503EE
Packet 2: 1D0608054203EE
Packet 3: 1D0608427273747571505703EE
...