Made a version that should be more efficient for large csv files (though is based on a slightly more complex mechanism decomposing the template and doing the cycle through the rows separately)