Im having csv file with few columns which should contain data as shown below. Want to check if column 3 contain row with duplicate value(9876,9876) then corresponding to this in col2 should contain text "tax" and should not contain text "non".
Word "non" can come but if in column3 duplicate value are not present in rows, if a row contain only distinct value suppose 7623 then corresponding to this "non" can come in column 2.
Need to print error along with line number, if these condition are not met in file or col2 contain "non" against col3 contain duplicate value
With reference to above query, below is the objective i want to achieve looking into csv file.
Identify the rows with field(column-1) as INV and then on filtered list identify rows with identical values in the column-2 (document Number). In all such cases, check the value in field supplyType (column-3) and in that if any of the row has value TAX then in none of the other row should have value NON.
If column three contain duplicate values then against those values in column2 we can have values as "tax","SEZ", "ISD", etc but not value as "non". If value in column 3 does not contain duplicate value(only single or unqiue value) in rows, then column 2 can contain value "non" against those distinct(single) value of colum3.
here the last bundle of duplicate values of "1234"(column3) will be considered as wrong because in column 2 we are getting "non" against column 3(last row value 1234).
Instead it has to be "tax" at last row of column2.
For this error we need to print "error code" with line number.
---------- Post updated at 12:38 AM ---------- Previous update was at 12:14 AM ----------
Thanks for the code,
will execute the same and will let you know for issues if any.
thank you once again
Last edited by Don Cragun; 12-30-2017 at 12:20 AM..
Reason: Add CODE tags again.