Working CVS writer from query. Takes parameters for size, fields and repeat (if you want more values on one line).