Page 1 of 1

a lilltle complex scenario...plz help

Posted: Mon Mar 02, 2009 6:04 am
by arnie_nits
Hi,

I have got a complex scenarion. The below the the sample source data.

Items Date transit value($) on hand value($)

Shocks 01/02/08 0 1
casual wear 01/02/08 1 0
underwear 02/02/08 2 2
sports wear 01/02/08 5 9

now, all the DATE values should be same. If there is a mismatch( as in the above case),the whole set of records must go to the error file. Again If there is a Zero in either of the $ value columns (i.e transit val and on hand val), the whole set of record must go to the SAME error file.

Please suggest me any idea as to how to proceed.

Thanks and regards,
Arnie.

Posted: Mon Mar 02, 2009 6:44 am
by Sainath.Srinivasan
Are you asking the framework or solution to identify whether to reject or not?

What is the source? If db, you can do in SQL.

'uniq -c' on second column and a 'grep -c' on 3rd and 4th column (combined) can do.

Alternatively, an 'awk' through the data must solve your issue.