On Tuesday 11 August 2009 11:17:12 Richard Marza wrote:

> > For the moment, the script just prints out the lines where all the columns
> > don't have the same value.
> >
> > awk 'NR==1{print;next}{for(i=3;i<=NF;i++){if($i!=$2){print;break}}}'
> > file.txt
>
> This is great. But it is important that I find which system has a mismatch
> for each item. I guess this is where loops and if statements come in. I
> believe I have sufficient information. Although, more discussion is
> welcome. Thank you all.

If you have a way to tell "regular" values from discrepant ones, it's easy to 
modify the program to account for that and print only the values of discrepant 
columns. One way could be to look for the value that appears most times in a 
row, and consider that value normal and all the others discrepant. But again, 
you could have two values repeated the same number of times, so that would not 
help. That's why it's important to have an unambiguous rule.

Reply via email to