It sounds like XY problem, why do you specifically need those datas in csv format? If you're willing to share what you're trying to solve, some member might able to give better solution.
I want to collect all inputs and outputs of transactions with needed parameters. My idea is to create something like walletexplorer but with different heuristics. I have aws server with btc node. This data could be inother formats like json, xls. I could always convert it.