I am exporting an excel file from a software, and the following is the picture of it:
Here for some fruits there is both In and Out where 1 represents In and 0 represents Out.
Here is what I want to have: 1) Delete all the rows the first two times they appear for a particular fruit. For ex: Orange is being let In (1) and let Out (0), which means we are good on that. Same goes for every other fruit. Now, another case is Apple, which is let In (1) twice, and let Out (0) only once. Here only delete the first In (1) and the first Out (0) for Apple. And finally in the case of Watermelon, nothing needs to be done because it has only been let In (1). Same three conditions apply for all the fruits.
2) Now what I talked about in step 1 needs to be done in another file. So, when this file is exported, it automatically creates a copy of itself, and inside that copy, everything I mentioned in step 1 is done.
The final result in that copied file will look like the image below:
Here for some fruits there is both In and Out where 1 represents In and 0 represents Out.
Here is what I want to have: 1) Delete all the rows the first two times they appear for a particular fruit. For ex: Orange is being let In (1) and let Out (0), which means we are good on that. Same goes for every other fruit. Now, another case is Apple, which is let In (1) twice, and let Out (0) only once. Here only delete the first In (1) and the first Out (0) for Apple. And finally in the case of Watermelon, nothing needs to be done because it has only been let In (1). Same three conditions apply for all the fruits.
2) Now what I talked about in step 1 needs to be done in another file. So, when this file is exported, it automatically creates a copy of itself, and inside that copy, everything I mentioned in step 1 is done.
The final result in that copied file will look like the image below: