I have created an application that parses some text files and pulls out and sorts the information into a table
Here is a sample
NODE DSP Name BUS IDENT STATION REF1 REF2
nnn1_1 S|xxxx|A1 1 1 1 S|yyyyyyyyyy|A1 S|zzzzzzz|A1
mmm1_1 R|xxxx|A1 1 1 1 R|yyyyyyyyyy|A1 R|zzzzzzz|A1
xxx1_2 R|xxxx|A1 1 1 1 R|yyyyyyyyyy|A1 R|zzzzzzz|A1
yyy1_1 R|xxxx|A1 1 1 1 R|yyyyyyyyyy|A1 R|zzzzzzz|A1
I need to check 3 things
- That if in the DSP Name there is a
S|that it has at least one corresponding R| - That the corresponding
R|have identicalBUS,IDENT,STATION - That
REF1andREF2match names
I can sort of brute force my way through this pulling in the table one line at a time and building a list of all the (S|) and then once have that list search for the corresponding (R|)…
I already have the these in a datatable at one point, as well as a CSV file
Is there a simpler way to do this? Like LINQ?
Here’s something to get you started:
Once you get your results you’re going to have to do some combination of Substring to strip out the characters you don’t need, do comparisons, etc. My C# is rusty so sorry if the code isn’t quite right.