plaem
07-06-2018, 01:47 AM
I have an Excel file with the following structure:
ID
Value
A
0
A
1
B
0
B
0
B
1
C
0
D
1
What I would like to do is make a script that checks all rows corresponding to each unique ID and, when any of the rows contains a 1, delete all rows with that unique ID. I know how to check the values and delete the rows, but am having trouble to code the cycling through each ID and deleting all corresponding rows when the number is variable. Of course I can make a unique list of the ID's and loop through all rows, however that would not be efficient with the size of the data I have. If I sort the first column in alphabetical order, would it be possible to cycle through the ID's sequentially?
ID
Value
A
0
A
1
B
0
B
0
B
1
C
0
D
1
What I would like to do is make a script that checks all rows corresponding to each unique ID and, when any of the rows contains a 1, delete all rows with that unique ID. I know how to check the values and delete the rows, but am having trouble to code the cycling through each ID and deleting all corresponding rows when the number is variable. Of course I can make a unique list of the ID's and loop through all rows, however that would not be efficient with the size of the data I have. If I sort the first column in alphabetical order, would it be possible to cycle through the ID's sequentially?