Create a new address
sendfrom oldaddresslabel newaddress 1
sendfrom oldaddresslabel newaddress 1
sendfrom oldaddresslabel newaddress 1
[...]
sendfrom oldaddresslabel newaddress 1
sendfrom oldaddresslabel newaddress 1
sendfrom newaddress oldaddress 1000
Wait, you said it's 876 inputs per block. So that shouldn't actually work or am I missing something?
Would this require 1000 sendfroms with a value of 1 before I do the final sendfrom for 1000?
How are exchanges not getting hit with issues of sending various amounts?
Anyway, as far as I can see it you would need those 1000 sendfroms for the example, but that 1 is more or less a placeholder. You can use any number you're about certain that would work and that would depend how small those inputs of yours are. If you know the size of the smallest input it would be that * 876.
I don't know how you ended up with that huge a number of little inputs. An exchange, at least one that isn't actually staking, shouldn't have such split up inputs. Those little bot trading amounts for example just cause numbers to move in a database, no actual coins move between addresses anywhere. Then it's a matter of a little housekeeping and they could just use sendtoaddress since it wouldn't matter from what address those inputs come from as long as the amount is sent and the amount deducted from the correct account in the database.