I have a data set that looks something like this:
ID | ItemName | Category1 | Category2 | Category3
1 | HALv1 | Computer | Computer | AI
2 | HALv2 | Computer | AI | AI
3 | HALv3 | AI | AI | AI
Ideally I need it to look like this:
ID | ItemName | Category1 | Category2 | Category3
1 | HALv1 | Computer | AI |
2 | HALv2 | Computer | AI |
3 | HALv3 | AI | |
More specificaly, I need something (SQL or regular expression) that will evaluate 3 columns (like Category1, 2, 3 in the example above) in a row of data and return a row that has no duplicate values within the 3 designated columns.
The data is currently in a .csv file, but can be easily put into a mySQL database if needed.
Tools available are TextPad for executing regular expressions or MySQL 5.5.8 with PHPMyAdmin 3.3.9 if the solution is SQL based. Thank you in advance for your help.
This will cleanup rows like #1:
And row #2:
and row #3:
Handle all the cases that update category3 first, then category2.