Remove Row from a CSV File after Reading it

so I have a csv File that looks something like this:

tokenId,address
0,0x3ec9c3cb29ed95a396a48a4fbdb6b8546d001d5a
1,0x3ec9c3cb29ed95a396a48a4fbdb6b8546d001d5a
2,0x3ec9c3cb29ed95a396a48a4fbdb6b8546d001d5a
3,0x3ec9c3cb29ed95a396a48a4fbdb6b8546d001d5a
4,0x3ec9c3cb29ed95a396a48a4fbdb6b8546d001d5a
0,0x7470ea065e50e3862cd9b8fb7c77712165da80e5
1,0x7470ea065e50e3862cd9b8fb7c77712165da80e5
2,0x7470ea065e50e3862cd9b8fb7c77712165da80e5
3,0x7470ea065e50e3862cd9b8fb7c77712165da80e5
4,0x7470ea065e50e3862cd9b8fb7c77712165da80e5

There is a variable that gets each of these values one by one as an object like this:

{tokenId: '0', address: '0x3ec9c3cb29ed95a396a48a4fbdb6b8546d001d5a'}

Now what I want is that after my task with this variable is done, I want to check the csv file for the matching value and remove just that row by appending it in the existing file. Will love your help. Thanks