Deduplicating without changing original orders


The Excel file book1.xlsx has two columns of Car and Color. Part of the data is shown in the figure below:

Delete the repeated colors in each car without changing the original data sequence, as shown in the following figure:

Write SPL script:

A1 Read in book1.xlsx file data

A2 Group by Car and Color, the option @p means to return the sequence of numbers formed by the position of the group members in A1, 1 means that only the first record of each group will be taken after grouping

A3 After sorting the sequence in A2, take out the records of the corresponding serial number from A1 in this order

A4 Save A3 to the file book2.xlsx



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store