2 Replies - 347 Views - Last Post: 06 December 2012 - 06:08 AM Rate Topic: -----

#1 hacksaw74  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-October 12

Question for comparing rows in a table

Posted 05 December 2012 - 02:43 PM

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

1) That if in the DSP Name there is a S| that it has at least one corresponding R|
2) That the corresponding R| have identical BUS,IDENT,STATION
3) That REF1 and REF2 match 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?

Is This A Good Question/Topic? 0
  • +

Replies To: Question for comparing rows in a table

#2 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3665
  • View blog
  • Posts: 11,493
  • Joined: 05-May 12

Re: Question for comparing rows in a table

Posted 05 December 2012 - 05:41 PM

What's suppose to happen if one of the conditions is not met? Is it a matter of pass/fail for the entire data collection, or only a pass/fail for a given "S|" ?
Was This Post Helpful? 0
  • +
  • -

#3 hacksaw74  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-October 12

Re: Question for comparing rows in a table

Posted 06 December 2012 - 06:08 AM

For the first check it would only flag the individual "S|" row that had no corresponding "R|"

for the check 2 and 3 I would only highlight the cell mismatch
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1