Filter out Data for Scenario A=B,B=A then pick only one like A=B

sgnarkhede2016sgnarkhede2016 Member Posts: 152 Contributor II
I have Configuration File that contains combination Like
Att1            Att2
Customer beneficiary
beneficiary Customer
currency    Customer
Customer  Currency
receiver        Sender

Scenario Like  A=B,B=A then pick only one like A=B

Expected output
Att1            Att2
Customer beneficiary
Customer  Currency
receiver        Sender

Thanks In Advance

Best Answer

  • Options
    kaymankayman Member Posts: 662 Unicorn
    Solution Accepted
    This would require a lot of steps so not too sure if this is the best way to work on larger files.

    The idea would be to first generate an ordered list and then remove all the duplicates, so you get only the unique combinations left.
    Meaning if we have Customer Beneficiary the system would order them alphabetically so they become Beneficiary Customer instead. Once grouped only the unique ordered combinations remain.

    Now, since you are mixing upper case and lower case (currency and Currency) you probably want to convert all to lower case also as these are not the same for a machine (lower cases will be sorted before upper case, or the other way around...)

    Attached draft may get you started 

Sign In or Register to comment.