wellster34
Programmer
Hi,
I have a file:
10001|100.00|SOURCE1|
10001|100.00|SOURCE2|
10002|500.00|SOURCE1|
10002|1000.00|SOURCE2|
I need to compare the lines by reading them one by one and seeing if they differ in the amount fields by using the primary key as the uniqueness (first column). The SOURCE1 and SOURCE2 at the end indicate what source they are from. So basically, by using the primary key and comparing the numbers between the two sources. I need to report on any differences...
i.e. compare the following
10001|100.00|SOURCE1|
against
10001|100.00|SOURCE2|
to see if the numbers match. Since they match, no reporting required.
If they differ like:
10002|500.00|SOURCE1|
10002|1000.00|SOURCE2|
I need to report on both lines...
Is this possible in AWK? I was checking to see if I can store the values in variables but they would get overwritten when I read the next record... Any ideas?
Thanks for your time!
I have a file:
10001|100.00|SOURCE1|
10001|100.00|SOURCE2|
10002|500.00|SOURCE1|
10002|1000.00|SOURCE2|
I need to compare the lines by reading them one by one and seeing if they differ in the amount fields by using the primary key as the uniqueness (first column). The SOURCE1 and SOURCE2 at the end indicate what source they are from. So basically, by using the primary key and comparing the numbers between the two sources. I need to report on any differences...
i.e. compare the following
10001|100.00|SOURCE1|
against
10001|100.00|SOURCE2|
to see if the numbers match. Since they match, no reporting required.
If they differ like:
10002|500.00|SOURCE1|
10002|1000.00|SOURCE2|
I need to report on both lines...
Is this possible in AWK? I was checking to see if I can store the values in variables but they would get overwritten when I read the next record... Any ideas?
Thanks for your time!